home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / JORF21-1.ZIP;1 / JORFDOCS.ZIP / JORFMAN.TXT
Encoding:
Text File  |  1993-07-05  |  631.8 KB  |  22,384 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.                                   The JORF(R) Manual
  15.  
  16.  
  17.           As a member of the Association of Shareware Professionals we are
  18.           required to provide a full manual on disk in the shareware
  19.           version.  Please feel free to print this manual on your dot
  20.           matrix or laser printer.  It is about 350 pages long.  
  21.  
  22.           Since the JORF Company has spend considerable time, money and
  23.           effort creating this product, we will be proud to send you a real
  24.           manual, with graphic screen displays, printed and bound, when you
  25.           paty our very reasonable registration fee.  
  26.  
  27.                Free Shareware Version         Free     On Disk
  28.                Registered DOS Only Version     $45     Printed
  29.                Registered DOS/Windows Version  $85     Printed
  30.                JORF Developer's Kit           $170     Printed
  31.  
  32.           Thank you all advance for your support in the development of JORF
  33.           and the success of The JORF Company.
  34.  
  35.                                     Wayland Bruns
  36.                                    The JORF Company
  37.                                   25858 Elwood Road
  38.                                   Colton, OR  97017
  39.  
  40.                                     (503) 824-5673
  41.  
  42.  
  43.                         Copyright(c) 1993 by The JORF Company.
  44.                                  All Rights Reserved.
  45.  
  46.  
  47.           PRINTERS NOTICE:  All legitmate copyies of The JORF Manual are
  48.           printed by the JORF Company and will not carry this notice. 
  49.           Photocopying this manual is a violation of the copyright act.
  50.  
  51.  
  52.           JORF(R) is a Registered Trademark of The JORF Company.  Other
  53.           JORF Company products are trademarks of The JORF Company.  Other
  54.           brand and product names are trademarks of their respective
  55.           holders.
  56.  
  57.                          Please print this on recycled paper
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.                               The JORF License Agreement
  66.  
  67.           COPYRIGHT.  The JORF Interpreter and JORF Developer's Kit are
  68.           owned by The JORF Company and are protected by United States
  69.           copyright laws and treaty provisions.  By using this software you
  70.           are agreeing to be bound by the terms of this license.  If you do
  71.           not agree with this license, you may return all materials to The
  72.           JORF Company for a full refund.
  73.  
  74.           GRANT OF LICENSE.  The JORF Company grants you the right to use
  75.           one copy of the software for each paid registration.  You may
  76.           install the software on more than one computer, but you may use
  77.           only one copy at a time.  You must register each copy of the
  78.           software that you use at any one time to create new programs.  
  79.  
  80.           TRIAL COPIES.  The JORF Interpreter and JORF Language Tutorial
  81.           may be copied and distributed on a trial basis.  If you use the
  82.           software to create programs then trial is over and you must
  83.           register your copy with The JORF Company.  You may freely give
  84.           copies to your friends so they can try it.  If they use it to
  85.           create new programs they must register it.  
  86.  
  87.           RUNTIME MODULE.  The JORF Company grants you the royalty free
  88.           right to distribute the runtime module JORF.EXE with your
  89.           programs provided that; (a) your program does not directly
  90.           compete with JORF Company products; (b) your program displays a
  91.           copyright message that includes the word "Copyright", a "(C)",
  92.           the year, your name and the phrase "All Rights Reserved"; and (c)
  93.           you agree to indemnify, hold harmless, and defend The JORF
  94.           Company from and against any claims or lawsuits, including
  95.           attorney's fees, that arise or result from the use or
  96.           distribution of your program.
  97.  
  98.           OTHER RESTRICTIONS.  Persons or corporations involved with the
  99.           production of biological, chemical or nuclear weapons may not use
  100.           JORF Company Products.  JORF Company Products may not be used in
  101.           any type of weapons system.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.                                    LIMITED WARRANTY
  111.  
  112.           LIMITED WARRANTY.  The JORF Company warrants that the software
  113.           will perform substantially in accordance with the accompanying
  114.           written materials for a period of 90 days from the date of
  115.           receipt.  Any implied warranties on the software are limited to
  116.           90 days.  Some states do not allow limitations on duration of an
  117.           implied warranty, so the above limitation may not apply to you.
  118.  
  119.           CUSTOMER REMEDIES.  The JORF Company's entire liability and your
  120.           exclusive remedy shall be, at The JORF Company's option, either
  121.           (a) return of the price paid or (b) repair or replacement of the
  122.           software that does not meet The JORF Company's Limited Warranty
  123.           and which is returned to The JORF Company with a copy of your
  124.           receipt.  This Limited Warranty is void if failure of the
  125.           software has resulted from accident, abuse, or misapplication. 
  126.           Any replacement software will be warranted for the remainder of
  127.           the original warranty period or 30 days, whichever is longer.
  128.  
  129.           NO OTHER WARRANTIES.  THE JORF COMPANY DISCLAIMS ALL OTHER
  130.           WARRANTIES, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
  131.           LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  132.           A PARTICULAR PURPOSE, WITH RESPECT TO THE JORF SOFTWARE AND THE
  133.           ACCOMPANYING WRITTEN MATERIALS.  THIS LIMITED WARRANTY GIVES YOU
  134.           SPECIFIC LEGAL RIGHTS; YOU MAY HAVE OTHERS WHICH VARY FROM STATE
  135.           TO STATE.
  136.  
  137.           NO LIABILITY FOR CONSEQUENTIAL DAMAGES.  IN NO EVENT SHALL THE
  138.           JORF COMPANY OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES
  139.           WHATSOEVER (INCLUDING, WITHOUT LIMITATION, SPECIAL, INDIRECT
  140.           INCIDENTAL OR CONSEQUENTIAL DAMAGES, DAMAGES FOR LOSS OF BUSINESS
  141.           PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR
  142.           OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO
  143.           USE THIS PRODUCT, EVEN IF THE JORF COMPANY HAS BEEN ADVISED OF
  144.           THE POSSIBILITY OF SUCH DAMAGES.  BECAUSE SOME STATES DO NOT
  145.           ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL
  146.           OR INCIDENTAL DAMAGES, THE ABOVE LIMITATION MAY NOT APPLY TO YOU.
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.                                      Installation
  155.  
  156.           The JORF Company ships three interpreters and a developer's kit. 
  157.           The JORF interpreter is the smallest and fastest version of the
  158.           interpreter.  The JORF386 and JORFWIN interpreters act as a pair
  159.           to provide complete interpreter and debugger facilities in two
  160.           operating system platforms.  Finally, the JORF Developer's Kit
  161.           includes link libraries and batch files that enable you to
  162.           compile your JORF application programs.
  163.  
  164.                                      Requirements
  165.  
  166.           The JORF and JORF386 versions of the interpreter run on IBM PC
  167.           XT, AT 386 and 486 computers.  JORF can be run on a floppy disk
  168.           system but that is really painful; a hard disk is highly
  169.           recommended.  JORF386 requires a 386 computer.   
  170.  
  171.           The JORFWIN version of the interpreter runs under Windows 3.1 and
  172.           above.  It requires a 386 style computers using Windows in 386
  173.           Enhanced mode.  
  174.  
  175.                              Using JORF on a Floppy Drive
  176.  
  177.           You can use JORF on a dual floppy disk system.  To do this, put
  178.           the JORF.EXE program on one floppy disk, and the sample files on
  179.           another.  You will not be able to use ON-Line help.  You may need
  180.           to keep large programs like the TUTORIAL on separate disks.
  181.  
  182.           When starting JORF, please be sure you have 100K free on your
  183.           floppy disk.  That space will be used by the memory-swap file. 
  184.           Your programs can be run from the B drive.  If you need further
  185.           instructions, write or FAX the JORF Company.
  186.  
  187.                                 Hard Disk Installation
  188.  
  189.           The DOS and Windows distribution has two 5 ¨ disks or one 3 ´"
  190.           disk. To install, create an appropriate subdirectory, copy and
  191.           unpack the files that are appropriate.
  192.  
  193.                Create a JORF subdirectory:             MD \JORF
  194.                Copy files to that subdirectory:        COPY A:*.* 
  195.                Unpack standard 386 interpreter:        PKUNZIP JORF386
  196.                and/or Windows interpreter:             PKUNZIP JORFWIN
  197.                Always unpack sample files:             PKUNZIP JORFFILS
  198.                Optional help files:                    PKUNZIP JORFHELP
  199.                Optional Manual-on-disk:                PKUNZIP JORFDOCS
  200.                Save space by deleting the Zip files:   DEL *.ZIP
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.           Installation                                                    i
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.                                Installation Batch File
  217.  
  218.           If you can place the installation disk in floppy drive A:, and
  219.           you have a hard disk drive C with about 2 Megabyte free, you can
  220.           use INSTALL.BAT.  This file creates a directory called C:\JORF
  221.           and places the appropriate files in that directory.
  222.  
  223.                a.   Place the floppy disk in drive A: 
  224.                b.   Type A: to log to drive A.
  225.                c.   Type INSTALL to start the installation.
  226.                d.   Select version to install from the menu.
  227.                e.   If installing from low density disks, insert Disk 2
  228.                when prompted.
  229.  
  230.                              To Run The JORF Interpreter
  231.  
  232.           You can run the DOS version of interpreter by logging to the
  233.           appropriate directory and typing JORF.  To run the 386 version,
  234.           type JORF386.
  235.  
  236.           To run the Windows version of the interpreter, you must add the
  237.           JORFWIN application in the Program Manager.  From the File menu,
  238.           select New Application.  Type JORF for the name, and
  239.           C:\JORF\JORFWIN.EXE (using the appropriate disk and directory)
  240.           for the file to run.  Click Done to finish adding the
  241.           application. 
  242.  
  243.           The first time you run JORF, you should select TUTORIAL.J to load
  244.           and run the JORF Tutorial.
  245.  
  246.                           To Exit from The JORF Interpreter
  247.  
  248.           Pressing Alt-X will exit from any JORF program.  You can exit
  249.           from the current screen by pressing the Esc key. 
  250.  
  251.                              The JORF Initialization file
  252.  
  253.           If you have any problems with screen colors or display in the DOS
  254.           version, you should turn to Appendix D for information about
  255.           adjusting your  JORF.INI file. 
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.           The JORF Manual (Shareware Disk Version)                       ii
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.                               Version 2.1 Release Notes
  278.  
  279.           Version 2.1 was released in March, 1993.  The following notes are
  280.           for people who have used earlier versions so that they know what
  281.           areas have been improved and changed.
  282.  
  283.                 Perils and Pitfalls (Changes that affect working code)
  284.  
  285.           A new keyword Poly must now be used for polymorphic method calls. 
  286.           In prior versions, polymorphic calls were indicated by having no
  287.           class in front of the method name.  For instance, a polymorphic
  288.           call to a print a variable used to be Print(A), but now must be
  289.           changed to Poly:Print(A).  This change was made to increase
  290.           program speed and make polymorphic calls less ambiguous.
  291.  
  292.           The File:Read() and File:Write() functions no longer use the
  293.           Level argument.  All references to these functions in your code
  294.           should be modified to reflect this change.  If you have used
  295.           these functions you probably agree that this argument was
  296.           redundant.  File:Map() now acts more like and "Open" function,
  297.           and a new File:Close() function has been added.  File:Access()
  298.           has been renamed File:Exist().  These changes were introduced to
  299.           make it easier to read and write various types of data files.
  300.  
  301.           The Time:Get() and Time:Set() functions are totally different. 
  302.           Two internal types have been added for time and date. 
  303.           Conversions have been made even more flexible to make it easier
  304.           for stored date fields to be displayed according to the desired
  305.           format of the user.  Time and Date addition and subtraction
  306.           routines have been introduced.
  307.  
  308.           The action of the Tab key has been modified slightly.  When you
  309.           are editing text in a data entry window, you must now use Alt-Tab
  310.           to move the cursor eight spaces.  The Tab key now carries you to
  311.           the next field.  In prior versions, there was no way to Tab out
  312.           of text fields on a data entry screen.
  313.  
  314.                                      New Features
  315.  
  316.           The interpreter runs as much as 10 times faster for some
  317.           processes.  A lot of work has gone into decreasing disk access so
  318.           people can run the JORF interpreter from a floppy disk.  The
  319.           JORF386 interpreter uses 32-bit processing and VROOM to increase
  320.           speed and use high memory.  The JORF386 version must be run from
  321.           a hard disk on a 386 or 486 computer. 
  322.  
  323.           Clipper style DBF/DBT/NTX file support has been added.  Although
  324.           it would seem intuitive to support dBASE IV format, the vote from
  325.           the programmer community indicated that there are far more
  326.           Clipper applications than dBASE IV applications.  The support of
  327.           Clipper files enables programmers to duplicate and add to
  328.  
  329.           Installation                                                  iii
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.           existing Clipper applications without making their existing
  338.           programs obsolete.  People who use FoxBase and dBASE files can
  339.           still use JORF, but will have to avoid the Floating Point formats
  340.           and will not be able to use compatible indexes.
  341.  
  342.           The Win:Attr() function now allows you to set any of 16
  343.           background and foreground colors.  The "Blink" attribute has been
  344.           turned off under DOS, yielding 8 more background colors,
  345.           including dark gray and yellow. 
  346.  
  347.           The internal format of the JORF Pointer has been augmented.  New
  348.           types include a date type and a time type.  Partially implemented
  349.           is a BLOB (Binary Large Object) type that will enable developers
  350.           to store large strings and other binary data.  Under the new
  351.           system there is still room for eight more internal data types for
  352.           future expansion.
  353.  
  354.           The Program Editor now features colored syntax highlighting, with
  355.           different colors for functions, constants, numbers, punctuation
  356.           and comments.  This highlighting makes it easier to read the
  357.           code, and gives an instant "syntax check" to be sure you spelled
  358.           everything correctly.
  359.  
  360.           A "Type" and "Format" commands have been added to field input to
  361.           allow data to be type checked and reformatted automatically when
  362.           entered.  This capability allows numbers to be entered in numeric
  363.           format, and automatically redisplayed with commas and decimal
  364.           positioning.
  365.  
  366.           The JORF to C language translator is now a separate program
  367.           JTOC.EXE.  Much work has been done to decrease the size of
  368.           translated modules.  The libraries have been optimized with
  369.           smaller module sizes to increase speed under VROOM.  
  370.  
  371.           The internal storage format of a structure has been modified to
  372.           be more compact.  The format change is automatic when a structure
  373.           is written.  You can reformat a file by rebuilding it. 
  374.           Reformatting the Contact Manager JCM files yields new files that
  375.           are 25% the size of the old files.
  376.  
  377.           New sample programs include a Calendar date picker, a calculator,
  378.           and a screen color setting program.  The Contact manager has
  379.           split into two versions, MAILLIST.J is a simple version, and
  380.           CONTACT.J is more complex.   Some file handling programs have
  381.           been added.  On-Line help has been expanded.
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.           The JORF Manual (Shareware Disk Version)                       iv
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.                                   Table of Contents
  399.  
  400.                     Installation
  401.  
  402.                     Chapter One
  403.                          Welcome to JORF                        1
  404.  
  405.                     Chapter Two
  406.                          Getting Started                       15
  407.  
  408.                     Chapter Three
  409.                          JORF Math                             31
  410.  
  411.                     Chapter Four
  412.                          The Window Manager                    51
  413.  
  414.                     Chapter Five
  415.                          JORF Functions                        85
  416.  
  417.  
  418.  
  419.                     Appendix
  420.                                                               330
  421.  
  422.                     Index
  423.                                                               367
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.           Installation                                                    v
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.                                      Chapter One
  467.                                    Welcome to JORF
  468.  
  469.  
  470.  
  471.  
  472.  
  473.                                        Welcome
  474.  
  475.           JORF is an acronym for Josephine's Recipe Filer.  Josephine is a
  476.           tan pygmy goat who lives at the foot of the Cascade Mountains in
  477.           Oregon.  She does not file recipes but instead she dances and
  478.           plays in the sunshine.  Her message is simple; Lighten up, Eat,
  479.           Dance, Baaaah.  
  480.  
  481.           People laugh at Recipe Filers.  What a stupid use for computers
  482.           they say.  If think a moment, you will realize the joke is on
  483.           those that laugh.  Recipes are trivial "programs" that regular
  484.           people can understand and use.  The problem is that they have
  485.           unlimited ingredients and unlimited text, which makes it
  486.           difficult to file them with a relational data base manager. 
  487.           Recipes are not numeric enough to file with a Spreadsheet.  And
  488.           Recipes need to be indexed so you can not file them using a Word
  489.           Processor.  Instead of being trivial recipes are a good example
  490.           of everyday data that is too complex for most currently available
  491.           computer tools.
  492.  
  493.           JORF was written by me, Wayland Bruns, and The JORF Company is
  494.           another name for me and Josephine. We are open only part time,
  495.           Monday through Wednesday from 9-5 Pacific Time.  The phone number
  496.           is (503) 824-5673.
  497.  
  498.           You don't have a serial number, because I keep all registrations
  499.           by name.  Feel free to call or write at any time, and I will be
  500.           happy to talk to you if I have time.  Not that I have much time
  501.           any more, please write if you can. 
  502.  
  503.  
  504.                                      Introduction
  505.  
  506.           The JORF Language is a application building language for people
  507.           want to create DOS and Windows programs.  It is an Object
  508.           Oriented Programming language, featuring one data type, multiple
  509.           inheritance, classes, structures and polymorphism.  JORF brings
  510.           the power of OOP into the hands of people who will never have the
  511.  
  512.           Installation                                                    1
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.           time to learn complex OOP languages like C++ and Smalltalk.  JORF
  521.           gives you a way to program for Windows, without having to
  522.           understand the quirks of this complicated computing environment.
  523.  
  524.  
  525.                                      Basic Rules
  526.                    Indentation controls program flow.
  527.                    Labels are not sensitive to letter case.
  528.                    The end of line is the end of the line.
  529.                    Comments begin with a pipe symbol.
  530.                    Parentheses surround parameter lists. 
  531.  
  532.                                       Key Words
  533.                  Jorf The default data type.
  534.                  Class     Declares a structure (record).
  535.                  Parent    Designates a parent class.
  536.                  Index     Designates an index field.
  537.  
  538.  
  539.  
  540.           The JORF Language is not a scripting language.  It is a formal 
  541.           structured language that supports pointers, arrays, local data
  542.           and recursion.  It is the only Windows language (that I have
  543.           seen) that does not require a complex WinProc message handling
  544.           routine.
  545.  
  546.           The JORF Language uses a single data type, called a Jorf Pointer,
  547.           that can hold integers, floating point numbers, strings, and
  548.           blocks of text.  Object Oriented Classes are defined by the
  549.           programmer, and may include Structures, objects with more than
  550.           one element.
  551.  
  552.                                  Windows Programming
  553.  
  554.           The Windows culture is the culture of the WinProc; programs
  555.           dominated by massive unstructured switch statements that handle
  556.           esoteric message flags. As different products convert to Windows,
  557.           they unquestioningly adopt the WinProc culture.  BASIC, the
  558.           language for the beginner, becomes Visual Basic, a language for
  559.           precious few.  C programs become full of global values.  
  560.  
  561.           MS-Windows is so complicated that not even full time programmers
  562.           can learn every command and every subsystem.  This leaves no time
  563.           for Windows programmers to learn about their customers.  They are
  564.           doomed to write programs that cannot meet the particular needs of
  565.           these customer.  The legacy of Windows threatens to be like the
  566.           legacy of UNIX; expensive techies, weak programs.
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.           The JORF Manual (Shareware Disk Version)                        2
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.                              JORF Programming in Windows
  582.  
  583.           You won't see a WinProc in a JORF language program.  You won't
  584.           see anything more complicated than a procedural Win:Add function,
  585.           that creates a window with menus, buttons and data entry prompts. 
  586.           The JORF Window functions run identically under both MS-Windows
  587.           and DOS Text mode. 
  588.  
  589.           The Windows implementation of JORF is a subset of the
  590.           opportunities available under Microsoft Windows.   The JORF
  591.           Language supports the Windows "Look" while supporting just a
  592.           small subset of Windows functions.  Complexity is eliminated by
  593.           eliminating complex functions, and limiting the look of the
  594.           functions available.  
  595.  
  596.           The following program HELLO.J runs identically in both DOS and
  597.           Windows:
  598.  
  599.                Hello:Start
  600.                  Msg:Add ("Hello", "Ok")
  601.                    Welcome to the wonderful world of JORF!
  602.                  Return
  603.  
  604.           The program looks like this:
  605.  
  606.                     Under DOS                Under Windows
  607.  
  608.                                      The same JORF
  609.                                      programs runs
  610.                                      identically
  611.                                      under DOS, with
  612.                                      the same
  613.                                      buttons, menus,
  614.           mouse capability, and data structure.  This means that people who
  615.           have slower and smaller computers can still run your programs. 
  616.           Programs run considerably faster under DOS, but are not as pretty
  617.           and multiple programs cannot be run at one time.
  618.  
  619.                                 Program Logic and Flow
  620.  
  621.           There are six key words in The JORF Language; Class, Index,
  622.           Parent, Jorf (the default data type), And and Or.  These are
  623.           supplemented with Standard Library Functions written in the C
  624.           language and compiled into The JORF Interpreter.  This is how If,
  625.           While, Win:Add, and Move:To are implemented.  
  626.  
  627.  
  628.                                   Starting a Program
  629.  
  630.           Programs always start with the Start method.  This method may
  631.           belong to a class with the same name as the source file name, or
  632.           may be Jorf:Start.   
  633.  
  634.           Chapter One - Welcome to JORF                                   3
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.                                         Labels
  644.  
  645.           Class, Method, and Variable names are not case sensitive.  Names
  646.           can use letters, numbers or the underscore character.  Names
  647.           cannot start with a number.  The following table demonstrates
  648.           some legal and illegal names:
  649.  
  650.                Legal Labels        Illegal Labels Reason
  651.  
  652.                MyProgram      My Program     Embedded space not allowed
  653.                Num1           1Num           Cannot begin with a number
  654.                Num_2          Num-2          Punctuation illegal except for 
  655.            
  656.                A_1            A$1            underscore character
  657.                _Foo                          CAN begin with underscore
  658.  
  659.  
  660.                                     (Parentheses)
  661.  
  662.           Parentheses put items together to avoid any confusion about what
  663.           order to do math and other things.  
  664.  
  665.                2 + 3 * 4           | Equals 14
  666.                (2+3) * 4           | Equals  24
  667.  
  668.           Parentheses are also used to enclose the parameter list for a
  669.           method.  If there are no parentheses, the function is assumed to
  670.           have no parameters. 
  671.  
  672.                Win:Add("MyWindow") | Function with parameter
  673.                Win:Add()           | Function without parameter
  674.                Win:Add             | Same thing - empty
  675.                                    | parentheses are optional
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.           The JORF Manual (Shareware Disk Version)                        4
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.                                      Indentation
  705.  
  706.           Indentation controls program flow.  You must use proper
  707.           indentation for your program to work correctly.  That means you
  708.           won't have to type in curly brackets or ENDDO statements at the
  709.           end of your branching and looping structures.
  710.  
  711.           This example shows a For loop and nested If structure.  No "Next"
  712.           is necessary because the loop is closed by the unindented command
  713.           after the loop.
  714.  
  715.                Binary:Start
  716.                  New Char
  717.                  Win:Add ("BINARY VALUES", 4, 4, 19, 60, Here)
  718.  
  719.                  For (Char = 0 Thru 255)
  720.                    If (Char > 0 and (Char % 16 == 0))
  721.                      Win:Pause
  722.                      If Kbd:Got == "Esc_Key"
  723.                        Break
  724.                    Str:Put("     Character= {To:Str(Char,'000')} Symbol= ")
  725.                    Char:Put(Char)
  726.                    Str:PutLine("     Binary= {To:Str(Char,'0000 0000',2)}")
  727.  
  728.                  If Kbd:Got != "Esc_Key"
  729.                    Win:Pause
  730.                  Return (Ok)
  731.  
  732.  
  733.  
  734.           Here is an example of the program
  735.           output from BINARY.J.  This
  736.           counts up from zero to 255
  737.           displaying each character and
  738.           it's equivalent binary
  739.           expression.  Another related
  740.           example is ASCII.J which displays
  741.           a table of ASCII codes.
  742.  
  743.           Windows programmers will note
  744.           that JORF displays the IBM
  745.           character set, not the ANSI
  746.           character set that Microsoft
  747.           wants us all to switch to. 
  748.  
  749.                                       Parameters
  750.  
  751.           Parameters are normally passed by value, so that subroutines can
  752.           freely modify the value without affecting the same in the calling
  753.           routine.  Parameters may also be passed by reference so that the
  754.  
  755.  
  756.           Chapter One - Welcome to JORF                                   5
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.           subroutine explicitly modifies the value.  Use this when you need
  765.           more than one return value from a called method.
  766.  
  767.           Unlike the C or Clipper languages, JORF Programs mark variables
  768.           passed by reference in the parameter list of the subroutine. 
  769.           Once a parameter is declared by reference (using an asterisk) no
  770.           further notation is necessary for the data to be modified in the
  771.           calling method. 
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.                ByRef:Start
  779.                  | This test program shows the result of method that
  780.                  | uses a parameter (Foo) that is passed by reference.
  781.                  | Usually, parameters are passed by value, so that any
  782.                  | changes to the variable do not affect the calling
  783.                  | method.  Sometimes you want to affect the variable
  784.                  | in the calling method, which is why you want to
  785.                  | specify a parameter passed by reference.
  786.                  New (Foo,Fee)
  787.                  Foo = 7
  788.                  Fee = 7
  789.                  Win:Add("Example of Passing by Reference",0,0,9,56,Here)
  790.                  Str:PutLIne('In this example, the called method specifies that Foo be')
  791.                  Str:PutLIne('be passed by reference, and Fee be passed normally.')
  792.                  Str:PutLIne()
  793.                  Str:PutLine("   At start            Foo is     {Foo}, Fee is {Fee}")
  794.                  Str:PutLine()
  795.                  ByRef:Increment(Foo, Fee, 8, 8)
  796.                  Str:PutLine("   At end              Foo is now {Foo}, Fee is {Fee}")
  797.                  Win:Pause
  798.                  Return
  799.  
  800.                ByRef:Increment(*Foo,Fee)
  801.                  ++Foo
  802.                  ++Fee
  803.                  Str:PutLine("   In Increment method Foo is now {Foo}, Fee is {Fee}")
  804.                  Str:PutLine()
  805.                  Return (Ok)
  806.  
  807.  
  808.           When you run this program, it looks like this.  You can see that
  809.           Foo and Fee both start out as 7, and they are both incremented to
  810.           8 in the subroutine ByRef:Increment.  The difference comes when
  811.           the subroutine is ended and the program returns to the
  812.           ByRef:Start method.  At this point, Fee is still 7 because it was
  813.           passed by value, and therefore remains unchanged by the
  814.           subroutine.  But Foo has been changed to 8 because it was passed
  815.           by reference.
  816.  
  817.           The JORF Manual (Shareware Disk Version)                        6
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.              Data Base Manager
  827.  
  828.           The JORF Interpreter is
  829.           a transparent data base
  830.           manager.  The structure
  831.           definition acts as a
  832.           record definition, with
  833.           the different elements
  834.           acting as fields.  The
  835.           key word Parent can be
  836.           used to inherit fields and indexes from another class.  The key
  837.           word Index creates an automatic index on a field in a structure.
  838.           Other class names will designate the class of a field, which
  839.           influences the editing and formatting routines that are used.
  840.  
  841.           Class:MyRecord           | Creates new Class called "MyRecord"
  842.                Index:Contact       | Field name "Contact" is an index
  843.                Parent:Addr         | Inherit "Addr" fields and indexes
  844.                Phone:Work          | Field name "Work" is class "Phone"
  845.                Phone:Home          | Field name "Home" is class "Phone"
  846.                Index:PIndex   | Field name "PIndex" is an index.
  847.                Type           | Field name "Type" is Just a field
  848.                Note           | Field name "Note" can even be text
  849.  
  850.  
  851.           It is normal for a single file to contain several classes.  Data
  852.           files also contain the associated indexes for those classes. 
  853.           Each class can have many indexes.  Both data and indexes are
  854.           stored together in a single file, and contain relative pointers
  855.           so the file name and location may be changed.  
  856.  
  857.                Limit                         Real Limit     Practical Limit
  858.  
  859.  
  860.                Records per file              232        500, 5000, 50,000+
  861.                Fields per record             2048           100
  862.                Classes per file              Unlimited      1 - 10
  863.                Indexes per Class             2048           1 - 10
  864.                Parents per Class             2048           1 - 5
  865.                Length of a string field      10K            4048
  866.                Text field length limit       32K Lines      2000 Lines
  867.                Array elements                232             10,000
  868.                Integer size                  long
  869.                Floating point size           double
  870.  
  871.           Structure elements can be Integers, Floating point numbers,
  872.           Strings, Multiple Line Text and Arrays.  Arrays can contain sub-
  873.           arrays or other structures. 
  874.  
  875.           The practical record limit depends on what you are using the
  876.           records for.  If you need lightning fast access, as in list boxes
  877.  
  878.           Chapter One - Welcome to JORF                                   7
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.           or quick pick lists, you better keep your files below 500
  887.           records.  There is a discernable slowdown when a file goes over
  888.           about 1500 indexes, or about 500 records in a file that keeps
  889.           three indexes per record.  Seek speed remains under a second for
  890.           larger files, but programs that use large files (over 5000
  891.           records) should avoid long pick list displays since it takes some
  892.           time to read all the records on the list.
  893.  
  894.                                   Memory Management
  895.  
  896.           Why is it my fault when my computer runs out of memory?  It is
  897.           not my memory, why is it my fault?   Why do I have to "Open" a
  898.           file just to read data from it?  What exactly is "Opening"?  Why
  899.           can't I have two records available at the same time? 
  900.  
  901.           The JORF language handles its own memory, and your reward is
  902.           freedom to allocate large structures, arrays and text.  The JORF
  903.           memory can flush variables, methods, windows, internal values,
  904.           and even the program stack to disk whenever memory gets scarce. 
  905.           Data is read from file when you reference it, so there is no need
  906.           to "Read" it, and no difference between a "memory variable" and a
  907.           field in a record.  
  908.  
  909.           Text and Arrays are held in sparse chunks in memory.  Arrays are
  910.           held 16 elements at a time, and Text is held 4096 bytes at a
  911.           time.  Arrays remain fast even as they grow to enormous sizes. 
  912.           Text editing remains reasonably fast for text up to 100K.
  913.  
  914.                                   Object Persistence
  915.  
  916.           The JORF language can handle data storage almost automatically. 
  917.           Most data in JORF is held in Structures, units of data with
  918.           multiple elements.  Structures in JORF are the equivalent of
  919.           records in any data base language, except that in JORF you can
  920.           store more than one structure type in a single data file.
  921.  
  922.           Structures are created as memory variables, and are stored using
  923.           the Jorf:Write function.  Index fields may be declared in the
  924.           structure definition.  When indexes are declared, the interpreter
  925.           automatically handles index maintenance whenever the structure is
  926.           changed.  
  927.  
  928.           The JORF language has some unusual rules for structures in data
  929.           files.  These rules are quite different than those used in
  930.           relational data bases.  All fields in a JORF structure must be
  931.           stored in the same file.  If a structure contains a pointer to
  932.           another structure, both structures must be contained in the same
  933.           file.  If you attempt to point to a structure from another file,
  934.           for instance, an invoice record points to a customer in a
  935.           customer file, a copy is made so the entire customer structure
  936.           will be duplicated in the invoice file.  The only way to store
  937.  
  938.  
  939.           The JORF Manual (Shareware Disk Version)                        8
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.           the information in separate files it to create relational "link"
  948.           fields as you do in a relational data base.  
  949.  
  950.           The other rule to remember is simply that all indexes are stored
  951.           in the same file as the structures.  The reason for this is
  952.           simple.  A common problem in application programs happens when a
  953.           user restores one related file without restoring all files
  954.           necessary.  This often results in an Invoice file, for instance,
  955.           referencing customers that don't exist in a restored customer
  956.           file.  By keeping related information together, I hope to help
  957.           people avoid this type of file synchronization problem.
  958.  
  959.                                   Rule Based System
  960.  
  961.           The JORF Language includes indexing based on
  962.           Object-Attribute-Value rule triplets.  This system is used for
  963.           data base indexing and forward and backward chaining rule based
  964.           systems.  The rules also contain probability and a conditional
  965.           pointer for flexibility in expert systems applications.  
  966.  
  967.  
  968.                                  Network Applications
  969.  
  970.           The JORF language was built to create networked applications. 
  971.           (Always strikes me odd and unrealistic when a language like
  972.           db:Fast is introduced as single user only.)  Using JORF in single
  973.           user mode is faster, especially on slow computers, so when you
  974.           first start the system you will be in single user mode.
  975.  
  976.           To switch to multi-user network mode, you need only change your
  977.           JORF.INI or JORFWIN.INI file.  Just change the "MULTIUSER=NO"
  978.           line to "MULTIUSER=YES".  
  979.  
  980.           If you are using JORF on a non-networked drive, you will have to
  981.           load the MS-DOS utility SHARE.  Just put the word SHARE in your
  982.           AUTOEXEC.BAT file.  If you want to get fancy, you can load share
  983.           into high memory using the LOADHIGH command.  Even if you use MS-
  984.           Windows, you must load share.  The JORF interpreter will tell you
  985.           if SHARE is not loaded correctly.
  986.  
  987.           When you switch the MULTIUSER flag, the JORF language
  988.           automatically stops caching and starts file locking for index
  989.           operations.  This will slow the program down unless you have a
  990.           disk cache active (as most networks do).  If you have MS-Windows
  991.           on your system, you are probably using SMARTDRV (from the "If it
  992.           is in the name it isn't true" department of Microsoft).  SMARTDRV
  993.           is adequate to regain the lost speed.  
  994.  
  995.           The other part of Networking is the locking of Structures that
  996.           are being edited.  If Jan is editing a customer structure, you
  997.           must be sure that Bob cannot start editing the same structure at
  998.           the same time.  In a "Windows" type environment, locking is
  999.  
  1000.           Chapter One - Welcome to JORF                                   9
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.           complicated by the fact that Jan can change a field in a
  1009.           structure, and then pop up an entirely different window  and
  1010.           start a different operation without leaving the field that she is
  1011.           on.  
  1012.  
  1013.           That means that the programmer must arrange the program so that
  1014.           pull down menu and hot key options are only available after the
  1015.           structure change is complete and the structure is written to
  1016.           disk.  The sample program CONTACT.J shows how to use the
  1017.           INPBEFORE and INPAFTER screen commands to check the locking
  1018.           before and after every field is changed by the operator.  
  1019.  
  1020.           In JORF, the record locking functions are Jorf:Lock to lock a
  1021.           structure for changing, Jorf:Write to write and unlock the
  1022.           structure, and Jorf:Unlock to unlock and re-read a structure when
  1023.           an operator decides to abort a change operation.   A proper
  1024.           network application will be sure that all change operations are
  1025.           made on locked records.  More information on record locking is
  1026.           available in the reference areas for these functions. 
  1027.  
  1028.           The JORF File:Lock function can be used to lock an entire data
  1029.           file, and when you are done with changes you can use File:Unlock
  1030.           to release the lock.  These functions are best used for text file
  1031.           editing and for operations that change every structure in a file. 
  1032.           The Jorf:Rebuild function uses a file lock automatically.
  1033.  
  1034.                                  dBASE/Clipper files
  1035.  
  1036.           Version 2.1 of the JORF language introduces support for dBASE III
  1037.           files and Clipper NTX indexes.  This support is intended to allow
  1038.           Clipper programmers to create utilities and modules for existing
  1039.           Clipper applications.  In theory, with fewer lines, there will be
  1040.           fewer bugs. JORF gives you some access to high level Window
  1041.           Management routines that replace the "By-Hand" data entry
  1042.           checking that dominates many Clipper applications.  The JORF
  1043.           language has true "User Defined Functions" that are currently
  1044.           lacking in FoxPro, and has a reasonable compiled program size (A
  1045.           minimum of 250K, with most applications weighing in at about 500K
  1046.           to 1MB).
  1047.  
  1048.           While the JORF language will never replace the dBASE language as
  1049.           a programming tool, the dBASE file support allows you to
  1050.           experiment with programs while maintaining file compatibility
  1051.           with your existing application.
  1052.  
  1053.                                     Math And Logic
  1054.  
  1055.           Many Object Oriented Languages treat math operators as Method
  1056.           Calls.  This is really cute when you use "+" to concatenate a
  1057.           structures, and "=" to assign them.  However, this is not easy to
  1058.           implement and leads to a host of problems.  Instead, the JORF
  1059.  
  1060.  
  1061.           The JORF Manual (Shareware Disk Version)                       10
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.           Language uses a stack oriented math system like that in BASIC,
  1070.           PASCAL and C language.  
  1071.  
  1072.                                  Order of Operations
  1073.  
  1074.           The operations are handled in the following order:
  1075.  
  1076.                ->             Pointer References
  1077.                []             Array References
  1078.                - ! ~ ++ --    Unary operations
  1079.                * / %          Multiplication
  1080.                + -            Addition
  1081.                < > <= >=      Evaluation
  1082.                = == != <>     Equality
  1083.                && ??          Logical AND and OR
  1084.                =              Assignment
  1085.  
  1086.  
  1087.           Assignment is by value for simple elements and constants, and by
  1088.           reference for structures.  Throughout JORF, structures are
  1089.           handled as pointers.  Structures can be moved as "buffers" using
  1090.           the Jorf:Move function. 
  1091.  
  1092.           The JORF Language sees numbers as numbers, and automatically
  1093.           handles integer and floating point conversions.  Integer
  1094.           division, and integer addition and multiplication of large
  1095.           numbers may yield floating point results.  
  1096.  
  1097.           You can manually convert numbers using the To:Num, To:Str,
  1098.           To:Char and To:ASCII commands.  The Num:Min, Num:Max, Num:Int,
  1099.           Num:Abs, and Num:Pow functions give you extra capabilities with
  1100.           both integer and floating point values.
  1101.  
  1102.                              International Considerations
  1103.  
  1104.           I take this space to remind you, as a programmer, that computers
  1105.           are used the world around.  Although most programs are written in
  1106.           English, and users often become used to english language prompts
  1107.           in a program, the data they enter and use will be in their native
  1108.           formats.  That means that some thought should go into designing
  1109.           Address areas, dates and numeric formats. 
  1110.  
  1111.           To aid in handling date formats, the JORF To:Date and Date:Str
  1112.           functions use a format string that allows you to easily control
  1113.           the format.  The JORF language can store dates in a native data
  1114.           type.  Whenever that date is displayed, however, it can be freely
  1115.           reformatted to suit the desires of the operator.  The formatting
  1116.           system even allows you to change month names and dynastic year
  1117.           origin, so that you can easily accommodate string dates in many
  1118.           languages.
  1119.  
  1120.  
  1121.  
  1122.           Chapter One - Welcome to JORF                                  11
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.           Numeric formats are simpler because Arabic numbers are used for
  1131.           mathematics throughout most of the world.  Some countries,
  1132.           however, use the comma for a decimal point, and the period is an
  1133.           indicator for thousands.  When writing a JORF language program,
  1134.           you will have to write all numbers in the American period-decimal
  1135.           style.  If the user specifies "Decimal=," in the JORF.INI file,
  1136.           however, all numbers displayed and entered will be in the
  1137.           requested comma-decimal style.  
  1138.  
  1139.           This system allows programmers to write in a standard way and
  1140.           still accommodate users who wish to see their numbers notated
  1141.           differently.  See the reference section entries for the Num:Str
  1142.           and To:Num functions, and Appendix D Decimal= section for more
  1143.           information on comma-decimal formatting.
  1144.  
  1145.  
  1146.                                   The Window Manager
  1147.  
  1148.           The biggest feature of the JORF Language is the Window Management
  1149.           system that handles pull down and pop up menus, hypertext
  1150.           prompts, radio buttons, check boxes, and data entry fields.
  1151.  
  1152.           This system is handled entirely within the Win:Add function.  The
  1153.           syntax of the JORF window management system uses one command line
  1154.           for each data entry feature on the screen.  Command lines start
  1155.           with a command word and a quoted prompt string.  Various values
  1156.           can be added on the same line, or on indented lines below the
  1157.           command.  Different commands use different values.   Data entry
  1158.           will be in the order of the command lines. 
  1159.  
  1160.                Event:Add ("EditKey")
  1161.                Win:Add ("Title", Row, Col, Len, Wid, Level)
  1162.                  Command:"Prompt", Option:"value", Option:"value"
  1163.                    Option:"More Values can be Indented"
  1164.                    Option:"For as many lines as necessary"
  1165.                  Command:"Prompt", Option:"value", Option:"value"
  1166.                  Command:"Prompt", Option:"value", Option:"value"
  1167.                  You can also place a text paragraph at the bottom.  The 
  1168.                  system looks for the keyword and colon (:) character and
  1169.                  if they are absent will print the rest of the indented
  1170.                  screen definition as a text paragraph.
  1171.  
  1172.                  You can embed commands within text by enclosing some
  1173.                  commands in {Command:"Curly brackets, Option:"value"}.
  1174.                  This can be used for hypertext prompts and buttons that
  1175.                  are embedded in the text.
  1176.                Return
  1177.  
  1178.           Windows programmers may note that under windows, JORF uses the
  1179.           Windows menu handling system.  However, the JORF interpreter
  1180.           handles data entry fields without using the Windows Dialog box
  1181.           system.  Radio Buttons and Check boxes are a hybrid, where the
  1182.  
  1183.           The JORF Manual (Shareware Disk Version)                       12
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.           buttons are defined as child windows, but the prompts and
  1192.           keystrokes are handled by the JORF interpreter.  
  1193.  
  1194.                            The JORF Programming Environment
  1195.  
  1196.           The JORF interpreter contains a built in program editor and
  1197.           source level debugger.  To start the debugger, press Ctrl-Break
  1198.           at any time.  The debugger has a menu with options to allow you
  1199.           to edit the program, examine the stack, or trace through the
  1200.           code.
  1201.  
  1202.           Both the debugger and the editor are written in the JORF
  1203.           language, and they are a good example of some capabilities in the
  1204.           language.    The debugger allows you to edit live programs,
  1205.           rewind the program pointer, and execute your new code without
  1206.           restarting the program.
  1207.  
  1208.                                Using an Outside Editor
  1209.  
  1210.           You can also use an outside editor to edit JORF programs.  Simply
  1211.           edit the appropriate source file.  The next time you run it the
  1212.           interpreter will automatically reload your changes.
  1213.  
  1214.                                    Translating to C
  1215.  
  1216.           The JORF Company offers a developer's kit that allows you to
  1217.           translate and compile your JORF program code.  With this kit,
  1218.           your code will be translated to C.  You then can use any of the
  1219.           listed compilers below to compile the program to be a true EXE
  1220.           file.  You can also use the kit to link your JORF modules to C
  1221.           program modules to create a combined application program.
  1222.  
  1223.           Cautionary
  1224.           note:     JORF program code does not translate into clean C code
  1225.                     any more than C code translates into clean assembler
  1226.                     code. A JORF variable can be a string, number or
  1227.                     multiple line text, and has an ambiguous data type when
  1228.                     declared.  C language variables are never ambiguous. 
  1229.                     To keep compatibility with the language, a variable in
  1230.                     JORF remains a JORF pointer in C, and is not translated
  1231.                     to the C integer or string data types.  For this
  1232.                     reason, C programs in JORF only get moderate boost
  1233.                     (about 5 times faster) from the compiling process.  
  1234.  
  1235.                     The primary benefit of compiling is that you can
  1236.                     distribute the resulting EXE file without royalty and
  1237.                     without your customer being able to see or modify your
  1238.                     source code.
  1239.  
  1240.           The Developer's kit is ideal if you want to compile small
  1241.           programs (under 100K source code).  It comes equipped with batch
  1242.  
  1243.  
  1244.           Chapter One - Welcome to JORF                                  13
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.           files that make it easy to compile DOS and Windows programs, even
  1253.           if you know nothing about the C language.   
  1254.  
  1255.           If you need to link outside routines in your program you will
  1256.           have to know something about the C language to be successful.  If
  1257.           your program is large (over 100K source code) you will probably
  1258.           have to split it into multiple modules and compile them
  1259.           separately.  This process requires building a Borland Link script
  1260.           and a root module to bring the program together. You will also
  1261.           have to learn about VROOM enough to be sure your modules are
  1262.           loading into Virtual memory under DOS, instead of precious
  1263.           program memory. 
  1264.  
  1265.           The JORF Developer's kit costs $170 and is available only from
  1266.           The JORF Company.  You also need the Borland Turbo C++ (about
  1267.           $105), Turbo C++ for Windows (about $105) or Borland C++ compiler
  1268.           for DOS and Windows (about $395).   Programs compiled using the
  1269.           JORF Developer's kit may be distributed without paying any
  1270.           royalty to the JORF company.
  1271.  
  1272.           Please specify which compiler version you have, Borland has been
  1273.           playing with the object file format.  We normally ship libraries
  1274.           for the current Borland versions. (3.1 as of January 1993).
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.           The JORF Manual (Shareware Disk Version)                       14
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.                                      Chapter Two
  1321.                                    Getting Started
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.                                    Getting Started
  1328.  
  1329.           This chapter introduces the JORF Interpreter, Debugger and Editor
  1330.           that you can use to edit JORF language programs.  If you are an
  1331.           experienced programmer, you will probably just scan through here,
  1332.           and just hack your way through the menus.  If you are new at
  1333.           programming, you might find this chapter covers the debugger a
  1334.           little too quickly.  The JORF Programmer's Workbook goes into a
  1335.           more thorough examination of the Debugger, and shows you how to
  1336.           use each feature in a Step-By-Step fashion.  
  1337.  
  1338.           There are three versions of the JORF Interpreter:
  1339.  
  1340.           JORF      The regular interpreter for DOS PC computers
  1341.  
  1342.                     You can run JORF version by changing to the JORF
  1343.                     directory, and typing JORF:
  1344.  
  1345.                     C>CD \JORF          Change to the JORF directory
  1346.                     C>JORF         Type JORF
  1347.  
  1348.           JORF386   The JORF interpreter for 386 computers that takes
  1349.                     advantage of high memory and 32-bit processing speed.
  1350.  
  1351.                     You can run the JORF386 version by changing to the JORF
  1352.                     directory, and typing JORF:
  1353.  
  1354.                     C>CD \JORF          Change to the JORF directory
  1355.                     C>JORF386      Type JORF386
  1356.  
  1357.           JORFWIN   The Windows interpreter for running under MS-Windows
  1358.                     3.x
  1359.  
  1360.                     From the Program Manager, add the JORFWIN Icon by
  1361.                     selecting File - New.  Select Program Item and press
  1362.                     the OK Button.  Fill out the screen as shown.
  1363.  
  1364.  
  1365.  
  1366.           Chapter One - Welcome to JORF                                  15
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.                     After
  1383.                     pressing OK
  1384.                     again, you
  1385.                     should be able to see the JORFWIN Icon.  After this,
  1386.                     you can run the Windows version simply by clicking the
  1387.                     JORFWIN Icon.
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.                                   Shareware Message
  1409.  
  1410.           I have been experimenting with a Shareware Opening screen.  This
  1411.           screen features a short message about the shareware license for
  1412.           the JORF Interpreter.  This screen is a simple reminder that the
  1413.           interpreter you are running is not registered, and that you must
  1414.           register it if you write new programs using it.  The registered
  1415.           version does not display the message. 
  1416.  
  1417.  
  1418.                                The Editor and Debugger
  1419.  
  1420.           The Editor and Debugger screen is a programming tool to let you
  1421.           add, change and run JORF language programs in the interpreter.  
  1422.  
  1423.           When you first start, the program displays a list of JORF file
  1424.           names for you to run. 
  1425.  
  1426.  
  1427.           The JORF Manual (Shareware Disk Version)                       16
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.           All JORF screens comply to the Common User Access standard which
  1436.           uses the following keystrokes:
  1437.  
  1438.                Tab Key or Down Arrow         Moves to next field or entry area
  1439.                Back-Tab Key or Up Arrow      Moves to previous field or entry area
  1440.                Enter key                     Presses "Default" button
  1441.  
  1442.  
  1443.           Be very careful here not to press the Enter key at the end of a
  1444.           field.  If this standard is not familiar to you, it may seem
  1445.           quite cumbersome.  I personally think the Tab key is too small
  1446.           and far away to be used for such an essential task as ending a
  1447.           data entry prompt.  But this standard is the emerging standard
  1448.           for PC programs, so if you grow accustom to it now, you will soon
  1449.           tire of the Non-standard programs you used before.
  1450.  
  1451.           The program I want you to run first is ASCII.J.  This short
  1452.           program displays a table of ASCII characters on the screen. 
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.           To select ASCII.J, Press the Tab key and arrow through the Files
  1482.           list  so that ASCII.J is highlighted.  Press Enter once to add
  1483.           ASCII.J to the program name field.  Press Enter again to "Run"
  1484.           the program.  
  1485.  
  1486.  
  1487.  
  1488.           Chapter Two - JORF Systems and Structures                      17
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.           When the ASCII.J program runs, it displays this following screen. 
  1499.           There are two buttons, one to exit, and one that displays "Lower"
  1500.           if the upper ASCII characters are showing, and "Upper" if the
  1501.           lower ASCII characters are showing.   Press the Enter key, Alt-U
  1502.           and Alt-L, or use your mouse to see this program run.
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.                     Getting into the debugger a data entry screen
  1537.  
  1538.           To start the debugger, all you need to do is press Ctrl-Break. 
  1539.           The break key is located on the top right corner of your
  1540.           keyboard.  If you have an IBM-PC keyboard, the break key is
  1541.           labeled Scroll-Lock Break.  If you have an IBM-AT keyboard, the
  1542.           key is labeled Pause Break.
  1543.  
  1544.           Programmers may note that Ctrl-C is a valid keystroke in JORF,
  1545.           and is not used as a break key.
  1546.  
  1547.  
  1548.  
  1549.           The JORF Manual (Shareware Disk Version)                       18
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.           When you start the debugger from a data entry screen, the
  1558.           debugger will start by displaying the method that created the
  1559.           screen.  To debug through a button press routine you need to
  1560.           trace into that routine.  The technique of tracing into button is
  1561.           covered in just a couple pages. 
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.           In this example, you can see that the debugger is showing us
  1591.           ASCII:START method.  This is the full program code for the start
  1592.           method of the ASCII.J program.  All this code says to do is to
  1593.           create a windows with a Display routine and two buttons.  There
  1594.           are also two markers around the first button, used to change the
  1595.           button depending on the display.  (If the upper ASCII characters
  1596.           are showing, the button says "Lower" and if the lower ASCII
  1597.           characters are showing, the button says "Upper".
  1598.  
  1599.           The highlighted bar shows the currently executing line.  If you
  1600.           have a color monitor, you will also see that the program text is
  1601.           highlighted in various colors.  Syntax highlighting is useful to
  1602.           help show you syntax and spelling errors.  Functions, methods,
  1603.           numbers, constants and punctuation are highlighted differently.
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.           Chapter Two - JORF Systems and Structures                      19
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.                                 Debugger Menu Options
  1619.  
  1620.           The main debugger screen has menu options for changing the
  1621.           program you are on, editing any method in the program, displaying
  1622.           variables, and tracing through the program.  You can display the
  1623.           pull down menus by holding down the Alt-key and pressing the
  1624.           highlighted letter.  If you have a mouse, you can use your mouse
  1625.           to make the selection.
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.                                   Debugger File Menu
  1645.  
  1646.           Open      Press F4 to open and run a new program.  This brings
  1647.                     you right back to the screen you started with a
  1648.                     selection of available programs to run.  Use your
  1649.                     mouse, tab or arrow keys to select a file name.  Type
  1650.                     in a path name if you wish to change directories.
  1651.            
  1652.  
  1653.                     Run.  Use the Run
  1654.                     button to run the
  1655.                     program. 
  1656.  
  1657.                     Edit.  The edit button
  1658.                     will return you to the
  1659.                     debugger and editor,
  1660.                     without editing the
  1661.                     program.
  1662.  
  1663.                     Re-Read.  Sometimes you
  1664.                     try to run a program,
  1665.                     and nothing happens.  This usually follows an incident
  1666.                     where the program locked up.  The reason this happens
  1667.                     is that the .JRF file that contains the program is
  1668.                     corrupted.  This option erases and re-creates this file
  1669.                     from the source file.  If you have made changes to the
  1670.  
  1671.           The JORF Manual (Shareware Disk Version)                       20
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.                     program, you will lose any changes that were not saved.
  1680.  
  1681.  
  1682.                     Cancel. Pressing the Cancel button or the Escape key
  1683.                     will return you to the main editing screen.
  1684.  
  1685.           Save      When a program is run, the source is read into a .JRF
  1686.                     file.  This file contains the data in a special format
  1687.                     that is much faster to access than the original source
  1688.                     file.  When you make editing changes to the program,
  1689.                     these changes are made only to the .JRF file.  To save
  1690.                     these changes to the source file, you select the Save
  1691.                     option from the menu.
  1692.  
  1693.                     When the debugger saves a file it sets the methods in
  1694.                     the file in a particular order:
  1695.  
  1696.                          1.   Class Definitions alphabetically.
  1697.                          2.   The "Start" Method
  1698.                          3.   All methods alphabetically.
  1699.  
  1700.                     In more complex applications, several source files may
  1701.                     be open.  In this case, when you select Save, the file
  1702.                     that contains the currently displayed method is written
  1703.                     to disk.
  1704.  
  1705.           Save As   This option is the same as Save, but allows you to
  1706.                     specify a new source file name.
  1707.  
  1708.           Go        Press Alt-G at any time to stop editing and run your
  1709.                     program.  Program execution will continue from the
  1710.                     currently executing line.  
  1711.  
  1712.           Print     Use this option to print the program source code.  This
  1713.                     option works by saving all current changes (Same as
  1714.                     Save) and then printing the file from disk.  
  1715.  
  1716.                     Whenever you print from the JORF Interpreter, you will
  1717.                     be given a standard printer menu.  If the printer
  1718.                     options on this menu do not conform to your printer,
  1719.                     you can easily change them.  To change the printer
  1720.                     options, Run the SETUP.J program, or edit the JORF.INI
  1721.                     file according to the directions in Appendix D.  The
  1722.                     JORF.INI file is where the default printer list is
  1723.                     located, and it is really easy to set this up to suit
  1724.                     your system. 
  1725.  
  1726.           Restart   This option restarts your program from the beginning. 
  1727.                     Use it whenever you are changing method names or make
  1728.                     extensive changes in the source code.
  1729.  
  1730.  
  1731.  
  1732.           Chapter Two - JORF Systems and Structures                      21
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.           Re-Read   If your program locks up in the interpreter, you will
  1741.                     probably need this option.  Use it if you try to "Run"
  1742.                     or "Edit" a program and you get a blank screen instead. 
  1743.                     If the program were invalid, you would be told so.  But
  1744.                     if the program file exists in a corrupted state, the
  1745.                     Start method cannot be found, and the Debugger will
  1746.                     show only a blank screen.
  1747.  
  1748.                     This option erases the corrupted .JRF file and re-reads
  1749.                     the source program to re-create it.  Changes made after
  1750.                     your last Save will be lost.  I am constantly working
  1751.                     to a) make JORF so it doesn't lock up and b) make it so
  1752.                     it leaves the file uncorrupted.  However, until I
  1753.                     succeed you will have to use "Re-Read".
  1754.  
  1755.           Exit      Press Alt-X at any time to exit from the Debugger. 
  1756.  
  1757.                     There is a polite "Last Chance" box before you leave. 
  1758.                     If you press OK you will be returned to the DOS prompt
  1759.                     or to the Windows Program manager.
  1760.  
  1761.                                Debugger Edit Dialog Box
  1762.  
  1763.           When you select Edit from the debugger screen, you will see the
  1764.           following dialog box.  This box allows you to select Methods by
  1765.           Class, and enables you to Add, Change and Delete the methods.
  1766.  
  1767.  
  1768.  
  1769.  
  1770.                                  Methods and Classes
  1771.  
  1772.           The JORF language is Object Oriented.  In JORF, all methods
  1773.           (routines) must be prefixed by a class name.  Methods are grouped
  1774.           by class, and on this screen you must select class first, then
  1775.           method.  
  1776.  
  1777.           This system of naming methods does not make much sense with small
  1778.           programs like ASCII.J.  In fact, the whole system was only
  1779.           invented recently, after two decades of computer programming
  1780.           without classes.  In large programs, however, the practice of
  1781.           defining classes and keeping methods tightly bound to those
  1782.           classes has proven to be very efficient.  
  1783.  
  1784.           Generally, you should name a class by the type of data being
  1785.           operated on, and by the general function of the class.  Methods
  1786.           can be any name you want.  A good class has under 30 methods.  A
  1787.           good method has under 30 lines of code.  A good method should do
  1788.           just one task, not three or four.  The size of classes and
  1789.           methods is often specified as "Granularity" and good granularity
  1790.           comes from succinct classes and methods.
  1791.  
  1792.  
  1793.           The JORF Manual (Shareware Disk Version)                       22
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.           Edit      When you have specified a Method name and Class name,
  1828.                     press the Edit button to edit the method.  
  1829.  
  1830.           Cancel    This returns you back from whence you came.  If it did
  1831.                     anything else, the cancel button would not make much
  1832.                     sense, would it?
  1833.  
  1834.           Add       Type in a new method or Class name and press Add to
  1835.                     create that method.  There are two ways of creating a
  1836.                     new method.  One is to use this button to "Add" it, the
  1837.                     other is to use "Copy" to copy an existing method.  
  1838.  
  1839.                     When you add a method, the editor creates the method
  1840.                     beginning and end for you.  
  1841.  
  1842.                          MyMethod:Start
  1843.                               |
  1844.                               Return 
  1845.  
  1846.  
  1847.                     It does this only to avoid "Blank screen syndrome" and
  1848.                     give you a place to start typing.  The comment line in
  1849.                     the center is where you can write a comment about the
  1850.                     purpose of the method, and also type in the lines of
  1851.                     program code that will comprise the method.
  1852.  
  1853.  
  1854.           Chapter Two - JORF Systems and Structures                      23
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.           Delete    To truly get rid of a method, you can select Delete. 
  1863.                     You should be sure to save your program soon after, so
  1864.                     your delete is saved to the source file.
  1865.  
  1866.                     If you use an outside editor:  You will quickly learn
  1867.                     that the JORF interpreter re-reads your program
  1868.                     whenever you make a change.  When re-reading, however,
  1869.                     your changes are merged with the current program
  1870.                     routines in the .JRF file.  That means when you delete
  1871.                     a method in the source file, it will still remain in
  1872.                     the .JRF file.  If you delete a method in the source
  1873.                     file, you should also delete the .JRF file so that the
  1874.                     .JRF file is re-created.
  1875.  
  1876.           Copy      Instead of Adding a blank method, you can copy an
  1877.                     existing method and edit from your copy.  This is
  1878.                     especially useful for keystroke handling methods where
  1879.                     you may want to define several keys to do the same
  1880.                     thing.
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.           The JORF Manual (Shareware Disk Version)                       24
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.                                   Debugger Show Menu
  1925.  
  1926.           The Show menu groups together four options.  One to view the
  1927.           other screen, and three to show you what the interpreter sees in
  1928.           your program.
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.           Other 
  1958.           Screen    Select this option or press Alt-O to see your program
  1959.                     screen.  If you are running in DOS, your program screen
  1960.                     is completely hidden by the debugger screen.  This
  1961.                     option allows you to view your program.  
  1962.  
  1963.                     If you are running in Windows and you have a Super VGA
  1964.                     monitor, you may be able to move your program screen to
  1965.                     one side so you can view it at the same time as the
  1966.                     editor screen.  If not, you can use this option to show
  1967.                     your screen.
  1968.  
  1969.  
  1970.  
  1971.           Show
  1972.           Stack     When you are running a method that is called by a
  1973.                     method this option shows you all the methods that are
  1974.                     being called in order.  
  1975.  
  1976.           Chapter Two - JORF Systems and Structures                      25
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.                     In our little ASCII.J example this is hardly useful,
  1985.                     but in a "real" program you may be nested ten methods
  1986.                     deep, and it is often useful to see exactly which
  1987.                     methods were called to get where you are now.
  1988.  
  1989.           Show 
  1990.           Variables Use this option to see your currently active variables. 
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.                     You will see a short screen that shows:
  2012.  
  2013.                          1) Parameter values for the current method
  2014.                          2) New variables in the current method
  2015.                          3) The Mem:Ptr global variable pointer
  2016.                          4) The Win:Ptr for the current screen
  2017.  
  2018.                     If any value is a Structure, you can highlight it and
  2019.                     press Enter to see the values of that structure.  The
  2020.                     same goes for Mem:Ptr and Win:Ptr.  
  2021.  
  2022.           Add 
  2023.           Watch     Select this option to add a new Watch variable to the
  2024.                     screen as you are tracing.  This option is also
  2025.                     available from the Watches menu (covered in just a
  2026.                     couple pages) and so turn there for more information.
  2027.  
  2028.  
  2029.                                     Debugger Menu
  2030.  
  2031.           The debugger menu gives you the options to trace, rewind, and
  2032.           mark break points in a method.  The JORF debugger, like most
  2033.           Object Oriented debuggers, allows you to change currently
  2034.           executing programs without breaking execution.  When you finish
  2035.           your change, you simply continue the current run of the program. 
  2036.  
  2037.           The JORF Manual (Shareware Disk Version)                       26
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.           Once you get used to the capability of changing a program
  2046.           on-the-fly, you may find that static program debuggers are much
  2047.           less convenient.
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.           Programmers will note two pleasant additions to the usual trace
  2067.           functions.  
  2068.  
  2069.           The Rewind function can move the program pointer back up a
  2070.           routine.  You can use this option to back up over a changed line
  2071.           of code, and then re-execute it to set a variable to a new value. 
  2072.  
  2073.  
  2074.           The Finish function executes the program to the end of the
  2075.           current method, and begins tracing again on the next line.  Use
  2076.           this when you accidentally trace into a method.  By finishing,
  2077.           you will be right back to the spot you would have been if you
  2078.           traced over the method.  
  2079.  
  2080.           Go        Press Alt-G at any time to stop editing and run your
  2081.                     program.  Program execution will continue from the
  2082.                     currently executing line.  
  2083.  
  2084.           Do Line   Does the current line and stop at the next line.  If
  2085.                     this line calls another method, switches to show the
  2086.                     new method and stops on the first executing line of
  2087.                     that method.  
  2088.  
  2089.                     This option differs from Next Line because it traces
  2090.                     into method calls.
  2091.  
  2092.           Next Line Runs the program until the next line.  This option
  2093.                     traces over any method calls in the highlighted line.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.           Chapter Two - JORF Systems and Structures                      27
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.           Rewind    Pressing Alt-R will rewind the program pointer back by
  2107.                     one line.  You can use this to rewind back over a
  2108.                     changed line in the program.  
  2109.  
  2110.                     There is an important
  2111.                     limitation to the rewind
  2112.                     function, you cannot rewind
  2113.                     out of an indented control
  2114.                     function, like If or While.  
  2115.                     As the screen suggests, you
  2116.                     need to move forward until
  2117.                     you are out of the indented
  2118.                     section, then rewind to the
  2119.                     line above the indented
  2120.                     section.
  2121.  
  2122.                     The Rewind function is not
  2123.                     the same as reverse
  2124.                     execution.  Program statements are not "Undone", and
  2125.                     counters and accumulators will not be unset by
  2126.                     rewinding.   The purpose of this command is not to undo
  2127.                     operation, but merely to allow you to fix a bug and re-
  2128.                     execute a section of a method with the fixed code.
  2129.  
  2130.                     Neither Mr. Borland nor Mr. Microsoft can do this
  2131.                     either.  Perhaps they should, since it makes it so easy
  2132.                     to debug code to be able to change it and re-execute
  2133.                     the new code with just a couple keystrokes.
  2134.  
  2135.           Finish 
  2136.           Method    Finishes the current method, and stops at the next
  2137.                     program line.  If you trace into a method using Do
  2138.                     Line, you can use this option to finish the method. 
  2139.                     The program control will stop as if you traced over the
  2140.                     method using Next Line.  Neither Mr. Borland nor Mr.
  2141.                     Microsoft and do this simple but useful function!
  2142.  
  2143.           Trace 
  2144.           Forward   Press Alt-T at any time to begin automatic trace mode. 
  2145.                     You can use this option to watch your program run.  As
  2146.                     it is running you can change the speed at which lines
  2147.                     are executed:
  2148.  
  2149.                               Press F to go faster
  2150.                               Press S to go more slowly
  2151.  
  2152.                     Press any other key to end automatic trace mode.
  2153.  
  2154.                     This mode is useful to get an overview of how a program
  2155.                     runs, and to see which methods are used for a given
  2156.                     function.
  2157.  
  2158.  
  2159.           The JORF Manual (Shareware Disk Version)                       28
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.           Toggle 
  2168.           Break 
  2169.           Point          Use this option to mark a line as a break point. 
  2170.                          When a line is marked as a break point, program
  2171.                          execution will stop just before that line is
  2172.                          executed, as if you pressed Ctrl-Break exactly at
  2173.                          that spot.
  2174.  
  2175.                     In the debugger, you can have up to ten break points. 
  2176.                     Usually, having more than 2 active at once is pretty
  2177.                     confusing.  
  2178.  
  2179.                     This option is a toggle, which means that executing it
  2180.                     once sets the break point on, and a second time sets
  2181.                     the break point off.  
  2182.  
  2183.                                  Debugger Watch Menu
  2184.  
  2185.           The JORF debugger has a special feature called "AutoWatches". 
  2186.           These are special watch variables that are changed and displayed
  2187.           according to the executed program code.  One autowatch will
  2188.           always show the value of the last assigned variable.  The other,
  2189.           shows whether the current conditional statement (If or While) is
  2190.           true.
  2191.  
  2192.           You can also set normal watch variables.  These are values that
  2193.           re-display with each program line so you can examine the status
  2194.           of the program.
  2195.  
  2196.           Add 
  2197.           Watch     Use this to add a watch
  2198.                     variable.  The screen
  2199.                     adjusts to show up to five
  2200.                     watch variables at one time. 
  2201.                     However, since each watch
  2202.                     variable must be
  2203.                     recalculated for every
  2204.                     program line, the more
  2205.                     watches you have, the slower the screen will display.
  2206.  
  2207.           Delete 
  2208.           Watches   This option will delete all program watch variables
  2209.                     except autowatches.  This will make your screen clean
  2210.                     and faster to redisplay.
  2211.  
  2212.           Autowatch
  2213.           On        When autowatch is on, the first watch variable will be
  2214.                     automatically set to be the current conditional value
  2215.                     and the second watch will be the last assigned value.
  2216.  
  2217.  
  2218.  
  2219.  
  2220.           Chapter Two - JORF Systems and Structures                      29
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.                     This Conditional is the result of the current If or
  2229.                     While statement.  In the example above, the if
  2230.                     statement is testing ((Char%8)==7).  (The % function is
  2231.                     read as "Mod", short for modulus, and is used to test
  2232.                     the  remainder of integer division.  In this case, we
  2233.                     are testing to see whether the value of Char divided by
  2234.                     eight leaves a remainder of seven.)
  2235.  
  2236.                     You can see in the screen above that the result is
  2237.                     (Null) so the executing line moved to the Else clause. 
  2238.  
  2239.                     The second watch was set in the For statement to the
  2240.                     variable Char which has a value of 128.  The assignment
  2241.                     watch is set whenever a variable is assigned using the
  2242.                     equals (=) sign.  
  2243.  
  2244.           Autowatch 
  2245.           Off       When I created the Autowatches, I was heartbroken to
  2246.                     find that they are barely usable on an XT style
  2247.                     computer.  This style computer is so slow, that testing
  2248.                     and displaying the Autowatch variables is just painful
  2249.                     to watch.  If you have a slow computer, or feel that
  2250.                     Autowatches are not very useful, you can turn them off. 
  2251.                     Turning off autowatches does not affect your defined
  2252.                     watch variables.
  2253.  
  2254.                                     Debugger Help
  2255.  
  2256.           The Help options on the debugger screen give access to keyboard
  2257.           references and to the context sensitive help system.
  2258.  
  2259.           Editing 
  2260.           Keys      Select this option to get a list of editing keys.  JORF
  2261.                     uses old Wordstar control keys, and also IBM keyboard
  2262.                     arrow and home keys.  
  2263.           Debugger 
  2264.           Keys      Select this option to get a list of debugger Alt
  2265.                     keystrokes.
  2266.  
  2267.           JORF 
  2268.           Help      Select this option, or press F1 to use the JORF context
  2269.                     sensitive help system.   This system uses a file called
  2270.                     HELP.JRF which needs to be on the current directory,
  2271.                     your start up directory, or the \JORF directory of your
  2272.                     current disk drive.  
  2273.  
  2274.                     You can use the context sensitive help by highlighting
  2275.                     program key words.  If the word at the cursor position
  2276.                     is a listed keyword, you will see the help screen
  2277.                     appropriate to that word.  For instance, place the
  2278.                     cursor on Win:Add and press F1 to see the help screen
  2279.                     on the Win:Add function.  
  2280.  
  2281.           The JORF Manual (Shareware Disk Version)                       30
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.                                     Chapter Three
  2297.                                       JORF Math
  2298.  
  2299.  
  2300.  
  2301.  
  2302.                                       JORF Math
  2303.  
  2304.           Many Object Oriented Languages treat math operators as Method
  2305.           Calls.  This is really cute when you use "+" to concatenate a
  2306.           structures, and "=" to assign them.  However, this is not easy to
  2307.           implement and leads to a host of problems.  For instance, to
  2308.           implement "+", you have to create a language syntax between
  2309.           operators.  This is the reason Smalltalk program lines are
  2310.           scrambled, and C++ has an involved "Friend" system. 
  2311.  
  2312.           When this is all done, it is hard to figure out how to handle a
  2313.           "+" between different types of objects.  You can create a method
  2314.           for Dog + Dog, but what about Dog + Penguin?  Is that a Doguin or
  2315.           a Pog?  And you have slowed down all regular math processing just
  2316.           to implement this difficult to use feature.
  2317.  
  2318.           For about two months, JORF used this math technique.  But there
  2319.           were so many kludges to make the syntax work, keep order of
  2320.           operations, and enhance speed that the entire system was not
  2321.           simple and intuitive.  So, I dumped the concept and went to a
  2322.           stack oriented math system like that in BASIC, PASCAL and C
  2323.           language.  
  2324.  
  2325.           The JORF system solves math operations automatically as the
  2326.           programming line is executed.  The line is executed from Right to
  2327.           Left (the opposite of how you read).  As each Method or Function
  2328.           is called, any adjacent Math expressions are completed.
  2329.  
  2330.                Win:Add (To:Caps(Title), LastRow+2, LastColumn+5, 0, 0, Here)
  2331.  
  2332.           JORF first performs Here.  Then it reads the line back to the
  2333.           To:Caps function.  Before performing it, it evaluates the math
  2334.           expressions LastRow+2 and LastColumn+5 even though they are
  2335.           unrelated to To:Caps.  Until JORF calls a function it doesn't
  2336.           know how many parameters that function takes.  To:Caps Title will
  2337.           return the contents of Title capitalized.  Finally, the Win:Add
  2338.           function is called. 
  2339.  
  2340.  
  2341.  
  2342.           Chapter Two - JORF Systems and Structures                      31
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.                                  Order of Operations
  2351.  
  2352.           Mathematic operations are handled in the following order.  This
  2353.           is essentially the same as the C language:
  2354.  
  2355.                     ->                  Pointer References
  2356.                     []                  Array References
  2357.                     - ! ~ ++ --         Unary operations
  2358.                     * / %               Multiplication
  2359.                     + -                 Addition
  2360.                     < > <= >=           Evaluation
  2361.                     == !=               Equality
  2362.                     && ?? And Or        Logical AND and OR
  2363.                     =                   Assignment
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395.  
  2396.  
  2397.  
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.           The JORF Manual (Shareware Disk Version)                       32
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.                                      Addition (+)
  2413.  
  2414.  
  2415.  
  2416.           Symbol    +
  2417.  
  2418.           Purpose   Add numbers, concatenate strings. 
  2419.  
  2420.           Notes     The plus sign adds numbers if both sides are numbers,
  2421.                     and if one or both operands are strings then they are
  2422.                     concatenated.  
  2423.  
  2424.                     To "Add" text you must use the Text:Add function.  To
  2425.                     "Add" elements of structures, use the strange and
  2426.                     obscure Jorf:Move function.
  2427.  
  2428.           Examples
  2429.                     1 + 5 = 6
  2430.                     2 + 78.8 = 80.8
  2431.                     5 + "A"  = 5A
  2432.                     To:Str(3) + To:Str(3) = "33"
  2433.                     65535 + 1 = 65536
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.           Chapter Three - JORF Math                                      33
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.                                     Assignment (=)
  2474.  
  2475.  
  2476.  
  2477.           Symbol    =
  2478.  
  2479.           Purpose   Assign a value to a variable. 
  2480.  
  2481.           Notes     Assigns the value of the right operand to the left
  2482.                     operand. 
  2483.  
  2484.                      Usually, only the value is assigned and not the class. 
  2485.                     If the destination has no declared class, and the
  2486.                     source does, the destination will take on both the
  2487.                     class and value of the source.  
  2488.  
  2489.                     Assignment may be made to structure elements and
  2490.                     arrays.  You cannot assign "To" a constant value. 
  2491.                     Single data items are assigned by value, but structures
  2492.                     and text are assigned by reference.
  2493.  
  2494.  
  2495.           Examples
  2496.                     A = 6                    | A is now equal to 6
  2497.                     Addr->Addr1 = "2343 N. Main Street"     | Sets the Addr1 element of Addr
  2498.                     Addr[4] = Addr           | Sets the fourth array element
  2499.                     "Three" = 2              | Nonsense!  Three is a constant
  2500.                     Three = 2                | If three is a variable, O.K.
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.           The JORF Manual (Shareware Disk Version)                       34
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.                                     Decrement (--)
  2535.  
  2536.  
  2537.  
  2538.           Symbol    --
  2539.  
  2540.           Purpose   Subtract one from a number. 
  2541.  
  2542.           Notes     It is a common operation in programs to have loop
  2543.                     counters that count up by one, or down by one.  These
  2544.                     are so common in assembler that there are real assembly
  2545.                     instructions to do just these operations.  
  2546.  
  2547.                     I'm afraid the JORF Translate and compile system is not
  2548.                     efficient enough to compile to the assembler decrement
  2549.                     instruction, but it is still a good concept and a
  2550.                     logical part of the language.
  2551.  
  2552.                     The Decrement operator must be IN FRONT of the operand,
  2553.                     and not behind as allowed in the C language.  This
  2554.                     operator simply subtracts one from the operand.
  2555.  
  2556.           Examples
  2557.                     Num = Num - 1            | Normal Decrementing
  2558.                     --Num                    | But -- is shorter, easier.
  2559.  
  2560.                     Decr:Start
  2561.                       New Num
  2562.                       Win:Add ("Showing Decrement", 4,4,12,30, Here)
  2563.                       Num = 10
  2564.                       While (Num > 0)             | Loop until zero
  2565.                         Str:PutLine ("Number = " + Num)     | Put 'Number = 10'
  2566.                         --Num
  2567.                       Str:PutLine ("Done")
  2568.                       Win:Pause
  2569.                       Return
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.           Chapter Three - JORF Math                                      35
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.                                      Division (/)
  2596.  
  2597.  
  2598.  
  2599.           Symbol    /
  2600.  
  2601.           Purpose   Divide two numbers. 
  2602.  
  2603.           Notes     You remember how to do long division don't you?  Well
  2604.                     the computer does, and this is what you need to do it.
  2605.  
  2606.                     The JORF language is unusual in that it does the type
  2607.                     conversions necessary when division yields a fractional
  2608.                     result.  Most languages truncate the result of integer
  2609.                     division.  You should be especially careful when using
  2610.                     division to calculate screen position, because the
  2611.                     fractional result is not the same as the truncated
  2612.                     result:
  2613.  
  2614.                               Move:To (2, (30-Str:Len "Hi Jo")/2)  
  2615.                     becomes   Move:To (2, (30-5)/2)  
  2616.                     becomes   Move:To (2, 25/2)
  2617.                     becomes   Move:To (2, 12.5)
  2618.                     becomes   Move:To (2, 13)
  2619.                     Not       Move:To (2, 12)     as it would in C or
  2620.           Pascal.
  2621.  
  2622.           Examples
  2623.                     12 / 2 = 5
  2624.                     60000 / 100 = 600
  2625.                     12.5 / .5 = 25
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.           The JORF Manual (Shareware Disk Version)                       36
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.                                   Equality (= or ==)
  2657.  
  2658.  
  2659.  
  2660.           Symbol    = or ==
  2661.  
  2662.           Purpose   Check to see if two numbers, strings or structures are
  2663.                     equal.  Checks text only for the current line, not the
  2664.                     whole text. 
  2665.  
  2666.           Notes     Returns TRUE if the left operand is equal to the right
  2667.                     operand.  
  2668.  
  2669.                     When I was a BASIC programmer, I could never discern
  2670.                     the difference between checking for Equality, and
  2671.                     assigning a value.  To me, the both were "Equals".
  2672.  
  2673.                     The C language not only warns of this ambiguity, but
  2674.                     does not work correctly at all if you ignore the
  2675.                     warnings.  It does exactly what you tell it, assigns or
  2676.                     checks, and not what you want it to do.
  2677.  
  2678.                     So JORF treads the line.  For BASIC programmers, the =
  2679.                     sign can be used for both equality checking and also
  2680.                     for assignment.  For C programmers, use == for
  2681.                     equality, and = for assignment.  In all examples, I
  2682.                     will use == because it is more robust.
  2683.  
  2684.           Examples
  2685.                     A = 1                    | Assignment of 1 to A
  2686.                     If (A == 2)              | Check equality, is A equal to 2?
  2687.                       Str:PutLine ("A is 2")
  2688.                     Else
  2689.                       Str:PutLine ("A is Not 2")  | Will print this line
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.           Chapter Three - JORF Math                                      37
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.                                     Increment (++)
  2718.  
  2719.  
  2720.  
  2721.           Symbol    ++
  2722.  
  2723.           Purpose   Add one to a counter. 
  2724.  
  2725.           Notes     It is a common operation in programs to have loop
  2726.                     counters that count up by one, or down by one.  These
  2727.                     are so common in assembler that there are real assembly
  2728.                     instructions to do just these operations.  
  2729.  
  2730.                     I'm afraid the JORF Translate and compile system is not
  2731.                     efficient enough to compile to the assembler decrement
  2732.                     instruction, but it is still a good concept and a
  2733.                     logical part of the language.
  2734.  
  2735.                     The Increment operator must be IN FRONT of the operand,
  2736.                     and not behind as allowed in the C language.  This
  2737.                     operator simply adds one to operand.
  2738.  
  2739.  
  2740.           Examples
  2741.                     Num = Num + 1            | Normal Decrementing
  2742.                     ++Num                    | But -- is shorter, easier.
  2743.  
  2744.                     Incr:Start
  2745.                       New Num
  2746.                       Win:Add ("Showing Increment", 4,4,12,30, Here)
  2747.                       Num = 0
  2748.                       While (Num < 10)       | Loop until zero
  2749.                         ++Num
  2750.                         Str:PutLine ("Number = "+Num) | Put 'Number = 1'
  2751.                       Str:PutLine ("Done")
  2752.                       Win:Pause
  2753.                       Return
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.           The JORF Manual (Shareware Disk Version)                       38
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.                                 Inequality (!= or <>)
  2779.  
  2780.  
  2781.           Symbol    != or <>
  2782.  
  2783.           Purpose   Test to see if two numbers are not equal. 
  2784.  
  2785.           Notes     I could never decide whether I like the BASIC <> or the
  2786.                     C language != better.  I know that I hate the Clipper
  2787.                     ambiguity where they are slightly different.  So, in
  2788.                     JORF they are exactly the same, but you can use either
  2789.                     symbol.  Since learning C brings higher salaries than
  2790.                     learning BASIC, I usually use the != (! means Not, =
  2791.                     Means Equals; Not-Equals) in my examples.  
  2792.  
  2793.  
  2794.           Examples
  2795.                     A = 1               | Assignment of 1 to A
  2796.                     If (A != 2)         | Check equality, is A not equal to 2?
  2797.                       Str:PutLine ("A is not 2")    | Will print this line
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.           Chapter Three - JORF Math                                      39
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.                                    Greater Than (>)
  2840.  
  2841.  
  2842.  
  2843.           Symbol    >
  2844.  
  2845.           Purpose   Test to see if the first operand is greater than the
  2846.                     second.
  2847.  
  2848.           Notes     Returns True if the First operand is greater than the
  2849.                     second.  Type conversion is the same as assignment. 
  2850.                     Numbers are compared numerically, and strings are
  2851.                     compared as strings.  String comparison is not case
  2852.                     sensitive. 
  2853.  
  2854.           Examples
  2855.                     1 > 5          False
  2856.                     "B" > "A"      True
  2857.                     "B" > "a"      True
  2858.                     "B" > 1        True because 1 is converted to "1"
  2859.                     "33" > 111     True because "33" is converted to 33
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.           The JORF Manual (Shareware Disk Version)                       40
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.                             Greater Than or Equal To (>=)
  2901.  
  2902.  
  2903.  
  2904.           Symbol    >=
  2905.  
  2906.           Purpose   Test to see if the first operand is greater or equal to
  2907.                     the second.
  2908.  
  2909.           Notes     Returns True if the First operand is greater than or
  2910.                     equal to the second.  Type conversion is the same as
  2911.                     assignment.  Numbers are compared numerically, and
  2912.                     strings are compared as strings.  String comparison is
  2913.                     not case sensitive. 
  2914.  
  2915.                     Reversing the symbols to be => has no meaning in JORF.
  2916.  
  2917.           Examples
  2918.                     1 >= 5              False
  2919.                     "B" >= "A"          True
  2920.                     "B" >= "b"          True
  2921.                     "B" >= 1            True because 1 is converted to "1"
  2922.                     "33" >= 33          True because "33" is converted to 33
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.           Chapter Three - JORF Math                                      41
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.                                     Less Than (<)
  2962.  
  2963.  
  2964.  
  2965.           Symbol    <
  2966.  
  2967.           Purpose   Test to see if the first operand is less than the
  2968.                     second.
  2969.  
  2970.           Notes     Returns True if the First operand is less than the
  2971.                     second.  Type conversion is the same as assignment. 
  2972.                     Numbers are compared numerically, and strings are
  2973.                     compared as strings.  String comparison is not case
  2974.                     sensitive. 
  2975.  
  2976.           Examples
  2977.                     1 < 5          True
  2978.                     "B" < "A"      False
  2979.                     "B" < "a"      False
  2980.                     "B" < 1        False because 1 is converted to "1"
  2981.                     "33" < 111     False because "33" is converted to 33
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.           The JORF Manual (Shareware Disk Version)                       42
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.                               Less Than or Equal To (<=)
  3023.  
  3024.  
  3025.  
  3026.           Symbol    <=
  3027.  
  3028.           Purpose   Test to see if the first operand is less than or equal
  3029.                     to the second.
  3030.  
  3031.           Notes     Returns True if the First operand is less than or equal
  3032.                     to the second.  Type conversion is the same as
  3033.                     assignment.  Numbers are compared numerically, and
  3034.                     strings are compared as strings.  String comparison is
  3035.                     not case sensitive. 
  3036.  
  3037.                     Reversing the symbol has no meaning in the current
  3038.                     version.  There is no =< operation.
  3039.  
  3040.           Examples
  3041.                     1 <= 5              True
  3042.                     "B" <= "A"          False
  3043.                     "B" <= "b"          True
  3044.                     "B" <= 1       False because 1 is converted to "1"
  3045.                     "33" > 111          False because "33" is converted to 33
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.           Chapter Three - JORF Math                                      43
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.                                    Logical AND (&&)
  3084.  
  3085.  
  3086.  
  3087.           Symbol    && or And
  3088.  
  3089.           Purpose   Test whether two logical values are both True. 
  3090.  
  3091.           Notes     An If statement uses the Logical And to make two tests
  3092.                     at once.  Each operand may be a test for equality, or
  3093.                     may be a test for null.  In JORF, Null, FALSE and Zero
  3094.                     are exactly the same.
  3095.  
  3096.                     The word "And" may now be used as a synonym for &&.  It
  3097.                     looks better, but gives And a funny status as kinda-a-
  3098.                     key-word.
  3099.  
  3100.                     The AND statement always evaluates both sides, without
  3101.                     shortcuts as in the C language.
  3102.  
  3103.           Examples
  3104.                     AndTest:Start
  3105.                       New A, B
  3106.                       A = 4
  3107.                       B = 2
  3108.                       Win:Add ("And Test", 0, 0, 10, 60, Here)
  3109.                       If (A And B)
  3110.                          Str:PutLine ("Test 1, Both A and B have values")
  3111.                       If (A & B)
  3112.                          Str:PutLine ("Test 2, Logical And, Bitwise & are different")
  3113.                       If (A < 5 And B > 4)
  3114.                          Str:PutLine ("Test 3, Use And to connect compound tests")
  3115.                       Win:Pause
  3116.                       Return
  3117.  
  3118.  
  3119.  
  3120.  
  3121.  
  3122.  
  3123.  
  3124.  
  3125.  
  3126.  
  3127.  
  3128.  
  3129.  
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.           The JORF Manual (Shareware Disk Version)                       44
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.                                  Logical NEGATION (!)
  3145.  
  3146.  
  3147.  
  3148.           Symbol    ! or Not
  3149.  
  3150.           Purpose   Test whether a logical values is not true. 
  3151.  
  3152.           Notes     You can reverse a logical statement using the logical
  3153.                     NOT.  It is usually more desirable to reverse the
  3154.                     logical test, especially if mixing Not, And and OR. 
  3155.                     Returns true if the operand is FALSE, Null or Zero.
  3156.  
  3157.                     The word "Not" may be used as a synonym for !.  
  3158.  
  3159.           Examples
  3160.                     NotTest:Start
  3161.                       New A, B
  3162.                       A = 4
  3163.                       B = 0
  3164.                       Win:Add ("Not Test", 0, 0, 10, 60, Here)
  3165.                       If (Not A)
  3166.                          Str:PutLine ("Test 1, A is not 'True'")
  3167.                       If (Not A And Not B)
  3168.                          Str:PutLine ("Test 2, Not can be ambiguous")
  3169.                       If Not (A < 5 And B < 5)
  3170.                          Str:PutLine ("Test 3, Use Not to reverse a test")
  3171.                       Win:Pause
  3172.                       Return
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.  
  3196.           Chapter Three - JORF Math                                      45
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.                                    Logical OR (??)
  3206.  
  3207.  
  3208.  
  3209.           Symbol    ?? or Or
  3210.  
  3211.           Purpose   Test whether one or the other of two logical values are
  3212.                     True. 
  3213.  
  3214.           Notes     An If statement uses the Logical Or to make two tests
  3215.                     at once.  Each operand may be a test for equality, or
  3216.                     may be a test for null.  In JORF, Null, FALSE and Zero
  3217.                     are exactly the same.
  3218.  
  3219.                     The word "Or" may now be used as a synonym for ??.  
  3220.  
  3221.                     You should be careful mixing And and Or in the same
  3222.                     expression.  Doing so can make the statement ambiguous. 
  3223.                     To avoid this, use parentheses so that each test
  3224.                     contains just one And or one Or. 
  3225.  
  3226.           Examples
  3227.                     OrTest:Start
  3228.                       New A, B, C
  3229.                       A = 4
  3230.                       B = 0
  3231.                       C = 6
  3232.                       Win:Add ("Or Test", 0, 0, 10, 60, Here)
  3233.                       If (A Or B)
  3234.                          Str:PutLine ("Test 1, One of A or B has a values")
  3235.                       If (A Or B And C)
  3236.                          Str:PutLine ("Test 2, Mixing can be ambiguous")
  3237.                       If ((A Or B) And C)
  3238.                          Str:PutLine ("Test 3, But Parentheses makes it clear")
  3239.                       Win:Pause
  3240.                       Return
  3241.  
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.  
  3255.  
  3256.  
  3257.           The JORF Manual (Shareware Disk Version)                       46
  3258.  
  3259.  
  3260.  
  3261.  
  3262.  
  3263.  
  3264.  
  3265.  
  3266.                                      Modulus (%)
  3267.  
  3268.  
  3269.  
  3270.           Symbol    %
  3271.  
  3272.           Purpose   Return the Integer remainder of Integer division. 
  3273.  
  3274.           Notes     The Modulus operator is used in conjunction with
  3275.                     counters to create cycles.  A cycle is a set of values
  3276.                     that loop.  To turn a numeric counter into the cycle 0,
  3277.                     1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4 you use the
  3278.                     modulus of 5. 
  3279.  
  3280.                          0 % 5 = 0 7 % 5  = 2     14 % 5 = 4
  3281.                          1 % 5 = 1 8 % 5  = 3     15 % 5 = 0
  3282.                          2 % 5 = 2 9 % 5  = 4     16 % 5 = 1
  3283.                          3 % 5 = 3 10 % 5 = 0     17 % 5 = 2
  3284.                          4 % 5 = 4 11 % 5 = 1     18 % 5 = 3
  3285.                          5 % 5 = 0 12 % 5 = 2     19 % 5 = 4
  3286.                          6 % 5 = 1 13 % 5 = 3     20 % 5 = 0
  3287.  
  3288.  
  3289.           Examples  My favorite is the use of modulus in the ASCII.J file. 
  3290.                     This program uses modulus start a new line every 16th
  3291.                     character. 
  3292.  
  3293.                     Ascii:Show(Base)
  3294.                       New (Char)
  3295.  
  3296.                       Win:Attr("Lo")
  3297.                       Move:To(1,1)
  3298.  
  3299.                       | Display 128 Ascii characters
  3300.                       For (Char = Base Thru 127+Base)
  3301.                         Str:Put(To:Str(Char,"000 "))
  3302.                         Char:Put(Char)
  3303.                         If ((Char %8)==7)
  3304.                           Str:PutLine()
  3305.                         Else
  3306.                           Str:Put("   ")
  3307.                       Win:Attr("No")
  3308.                       Return (Ok)
  3309.  
  3310.  
  3311.  
  3312.  
  3313.  
  3314.  
  3315.  
  3316.  
  3317.  
  3318.           Chapter Three - JORF Math                                      47
  3319.  
  3320.  
  3321.  
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.                                   Multiplication (*)
  3328.  
  3329.  
  3330.           Symbol    *
  3331.  
  3332.           Purpose   Multiply numbers. 
  3333.  
  3334.           Notes     Two numbers are multiplied.  If the numbers are
  3335.                     integers, and the result is very large, it may be
  3336.                     converted to floating point.  Multiplication of
  3337.                     floating point numbers can result in an integer result.
  3338.  
  3339.  
  3340.           Examples
  3341.                     20 * 55.5 = 1110
  3342.                     22.4 * 4  = 89.2 
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377.  
  3378.  
  3379.           The JORF Manual (Shareware Disk Version)                       48
  3380.  
  3381.  
  3382.  
  3383.  
  3384.  
  3385.  
  3386.  
  3387.  
  3388.                                      Negation (-)
  3389.  
  3390.  
  3391.  
  3392.           Symbol    -
  3393.  
  3394.           Purpose   Negates a number. 
  3395.  
  3396.           Notes     Unary negation is done by preceding any expression with
  3397.                     a minus sign.  This symbol negates the value.  
  3398.                     Parentheses are recommended to avoid ambiguity with the
  3399.                     subtraction operation.
  3400.  
  3401.                     The most common use is to pass a negative number to a
  3402.                     function.  Negative numbers.  
  3403.  
  3404.           Examples  The Windows program displays a few windows.  Positive
  3405.                     Row and Column positions are offsets from the top left
  3406.                     corner.  Negative Row and Column positions are offsets
  3407.                     from the bottom right corner. No matter how big or
  3408.                     small the screen, these boxes will be placed in the
  3409.                     same relative positions.
  3410.  
  3411.                     Windows:Start 
  3412.                       Win:Add ("Big", 2, 2, -2, -2) 
  3413.                       Win:Add ("Top Right", 3, 3, 3, 15) 
  3414.                       Win:Add ("Bottom Right",-3, 3, 3, 15) 
  3415.                       Win:Add ("Bottom Left", -3, -3, 3, 15) 
  3416.                       Win:Add ("Top Left", 3, -3, 3, 15) 
  3417.                       Win:Add ("Tall", 3, 45, -4, 10) 
  3418.                       Win:Add ("Wide", 10, 3, 3, -4) 
  3419.                       Win:Pause 
  3420.                       Return Ok
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.           Chapter Three - JORF Math                                      49
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448.  
  3449.                                    Subtraction (-)
  3450.  
  3451.  
  3452.  
  3453.           Symbol    -
  3454.  
  3455.           Purpose   Subtract two numbers. 
  3456.  
  3457.           Notes     The plus sign adds numbers if both sides are numbers,
  3458.                     and if one or both operands are strings then they are
  3459.                     concatenated.   Although it would make sense, multiple
  3460.                     line Texts are not concatenated, and are handle only as
  3461.                     the current line of text.  Also structures and arrays
  3462.                     are not concatenated.
  3463.  
  3464.           Examples
  3465.                          1 - 5 = -4
  3466.                          78.8 - 2 = 76.8
  3467.                          65536 - 1 = 65535
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.           The JORF Manual (Shareware Disk Version)                       50
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.                                      Chapter Four
  3517.                                   The Window Manager
  3518.  
  3519.  
  3520.            
  3521.  
  3522.  
  3523.                                   The Window Manager
  3524.  
  3525.           The JORF Window Management system handles pull down and pop up
  3526.           menus, hypertext prompts, radio buttons, check boxes, and data
  3527.           entry fields.  Cursor control between fields and mouse control is
  3528.           handled automatically.    
  3529.  
  3530.           The JORF window management system is handled entirely within the
  3531.           Win:Add and Win:Chg functions.  Both functions can be followed by
  3532.           a window definition section of commands.  Each command begins
  3533.           with a command verb, followed by a colon, followed by a quoted
  3534.           prompt.  The commands are defined in detail below.
  3535.  
  3536.           Although command verbs look like the class definition of a method
  3537.           call, they are not calls to JORF language methods.  The use of
  3538.           the colon in the key words is simply for consistency with the
  3539.           "look" of JORF language programs, and should not be mistaken for
  3540.           class oriented functions.
  3541.  
  3542.           A "Prototype" window is shown below:
  3543.  
  3544.                 Event:Add ("EditKey")
  3545.                 Win:Add ("Title", Row, Col, Len, Wid, Level)
  3546.                   Command:"Prompt", Option:"value", Option:"value"
  3547.                     Option:"More Values can be Indented"
  3548.                     Option:"For as many lines as necessary"
  3549.                   Command:"Prompt", Option:"value", Option:"value"
  3550.                   Command:"Prompt", Option:"value", Option:"value"
  3551.                   You can also place a text paragraph at the bottom.  The 
  3552.                   system looks for the keyword and colon (:) character and
  3553.                   if they are absent will print the rest of the indented
  3554.                   screen definition as a text paragraph.
  3555.  
  3556.                   You can embed commands within text by enclosing some
  3557.                   commands in {Command:"Curly brackets, Option:"value"}.
  3558.                   This can be used for hypertext prompts and buttons that
  3559.                   are embedded in the text.
  3560.                 Return
  3561.  
  3562.           Chapter Three - JORF Math                                      51
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.           You can see in the above example, there are a number of complex
  3571.           rules for declaring comments.  
  3572.  
  3573.                 Indented Text is subordinate to the Win:Add command. 
  3574.                 There can be additional indentations, but the window
  3575.                 definition ends at the end of the function or the next
  3576.                 unindented command. 
  3577.  
  3578.                 The Command section is always the first section in a
  3579.                 window definition.  It continues as long as there is a
  3580.                 Colon in the first expression of the line.  If the
  3581.                 expression is not a valid command word an error is
  3582.                 displayed.
  3583.  
  3584.                 The Text Section begins on the first line where there is
  3585.                 No Colon.  Some commands, notably the Prompt command that
  3586.                 is used for hypertext, can be included in the text section
  3587.                 if it is surrounded by Curly Brackets.
  3588.  
  3589.           Prompts and commands are handled as JORF language values.  They
  3590.           are quoted if they are strings, but not if they are numeric.  If
  3591.           they are unquoted, they are assumed to be variable values and
  3592.           must be valid parameters or new variables in the method that
  3593.           creates the window.  
  3594.  
  3595.           The sequence of fields during data entry follows the sequence the
  3596.           fields are declared.  
  3597.  
  3598.           The following is a summary of command values:
  3599.  
  3600.                 Array:""                An array pick list
  3601.                 Button:"Prompt"         A button
  3602.                 ChBox:"Prompt"          A check box
  3603.                 Group:"Prompt"          A group box (single line box)
  3604.                 Input:"Prompt"          A data entry field
  3605.                 List:""                 A record pick list
  3606.                 Marker:"Markername"     A marker section for Win:Chg
  3607.                 Menu:"Prompt"           A menu bar option 
  3608.                 MLine:"Prompt"          A menu line option
  3609.                 Prompt:"Prompt"         A hypertext prompt
  3610.                 Radio:"Prompt"          A radio button
  3611.                 String:"DisplayString"  A string (no data entry)
  3612.                 Text:""                 A data entry field 
  3613.  
  3614.           Keystroke handling is done by a combination of event system and
  3615.           automatic commands.  Every keystroke is first passed through the
  3616.           event handling system.  There is an event class called EditKey
  3617.           built into the interpreter that is the default key handler.  For
  3618.           your window to operate properly, you must set the Editkey class
  3619.           using the Event:Add command.
  3620.  
  3621.                     Event:Add ("EditKey")
  3622.  
  3623.           The JORF Manual (Shareware Disk Version)                       52
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.           This handler takes care of all letters and numbers, handles
  3633.           WordStar style control key functions, handles WordPerfect style
  3634.           Home, End and Page keys, and handles Arrow Keys.
  3635.  
  3636.           You can create a substitute handler for some or all keys.  Also,
  3637.           you can layer another handler on top of the existing handler. 
  3638.           This allows you to change defaults for a few keys without having
  3639.           to redefine an entirely new handler.  You might make a handler
  3640.           that makes the F7 key exit  the screen, instead of Alt_F4.  To
  3641.           use it you simply create a new class and define the routines. 
  3642.  
  3643.                 MyKeys:F7_Key
  3644.                   If (Editkey:FinishEdit)         | If OK to finish editing
  3645.                     Jorf:Exit                     |   Exit the program
  3646.                   Return (Ok)                     | Otherwise, return OK
  3647.  
  3648.                 MyKeys:Alt_F4_Key
  3649.                   Return ('Alt_F4_Key')           | Block Alt-F4 from further processing
  3650.  
  3651.           The first method does what Alt-F4 would normally do, execute the
  3652.           FinishEdit function to save the data and then exit.  The second
  3653.           method simply blocks the F10 key from further processing.  
  3654.  
  3655.           When a keystroke method is processed, the return value is
  3656.           critical in specifying further processing.  Possible return
  3657.           values are:
  3658.  
  3659.                 Null               Keystroke is not processed - continue checking event stack
  3660.                 Ok                 Keystroke is processed - processing is complete
  3661.                 The Keystroke      Keystroke is processed - and not changed
  3662.                 Another Keystroke  Keystroke is processed - and changed to this keystroke. 
  3663.                                    Used to change key combination into other printable
  3664.                                    characters.
  3665.  
  3666.  
  3667.           The above definition is a complete event class that redefines to
  3668.           keystrokes.  To use this class, layered above the normal Editkey
  3669.           class, means you use the Event:Add function twice:
  3670.  
  3671.  
  3672.           Event:Add      | A Null event blocks lower keystroke 
  3673.                 Event:Add ("EditKey")   | Normal Key Processing
  3674.                 Event:Add ("MyKey")     | Substitute for F7, F10
  3675.                 Win:Add ("Title", . . .)
  3676.                   ...
  3677.                 Return
  3678.  
  3679.           The event layering system enables you to trap and change any
  3680.           keystroke.  The layering allows you to add new functionality to
  3681.           any key, above what is already defined.  
  3682.  
  3683.  
  3684.           Chapter Four - The Window Manager                              53
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.           The complete EditKey class is given in source code form with the
  3693.           JORF Developer's Kit.  Having this code gives you the source code
  3694.           you need to create your own word processing system.  This source
  3695.           code is written in the JORF language, and is translated and
  3696.           compiled to the C language.  
  3697.  
  3698.                                 Windows Function keys
  3699.  
  3700.           Handling of keystrokes between fields conforms basically to the
  3701.           CUA standard supported by Microsoft Windows.  That means there
  3702.           are pre-defined keys that you should use in your programs.  Here
  3703.           is a list of keys built into JORF.
  3704.  
  3705.           Key                      Function            Who does it
  3706.  
  3707.           F1                       Help                     You do this.
  3708.           F3                       "Save Text"              Editkey
  3709.           Tab                      Next Input or Button     Automatic 
  3710.           Back-Tab                 Previ Input or Button    Automatic
  3711.           Alt-Keys                 Jump to menu/button      Automatic
  3712.           Arrow Keys               Up and Down              Automatic
  3713.           Enter Key on a Button    Executes Button          Automatic
  3714.           Enter Key on a field     Goes to next field       You do this.
  3715.           Space bar on radio       Toggles button           Automatic
  3716.           Escape Key               Exits Window             Automatic 
  3717.           Alt-X                    Exits Application        You do this.
  3718.           Alt-F4 Key               Exits Application        You do this.
  3719.  
  3720.           The F3 key is defined as a "Save" key in the Editkey processor
  3721.           routine.  It is automatically in effect when text is edited.  
  3722.  
  3723.           You must be sure to define F1 and Alt-F4 in Windows programs. 
  3724.           These keystrokes are so standard that you should always set them
  3725.           up.  DOS Programs also have a standard of using F1 as the help
  3726.           key.  DOS programs sometimes exit with Alt-Q instead of Alt-X,
  3727.           but one of these should always be defined.
  3728.  
  3729.           The CUA standard says that when you press the Enter key, the
  3730.           currently  highlighted button is executed.  Before buttons were
  3731.           common in DOS programs, the enter key was commonly used to end
  3732.           data entry in one field and move to the next field.  You can
  3733.           easily change JORF programs to support the DOS-like action, even
  3734.           though your program will be in flagrant violation of CUA
  3735.           standards.  Just use the following routine to change the
  3736.           keystroke:
  3737.  
  3738.                     MyProg:Enter_Key
  3739.                       Return ("Tab_Key")
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.           The JORF Manual (Shareware Disk Version)                       54
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.                                    Windows Alt Keys
  3754.  
  3755.           You can include an ampersand (&) character within any prompt to
  3756.           create an Alt key accelerator.  In the JORF language, these are
  3757.           handled automatically by the window management system.  Under
  3758.           DOS, Alt keys are highlighted, and in Windows programs they are
  3759.           underlined in menus, and highlighted when in screens. 
  3760.  
  3761.           Windows programmers may note that under windows, JORF uses the
  3762.           Windows menu handling system.  Windows data input fields were not
  3763.           amenable to handling by JORF, so JORF data entry fields are
  3764.           highlighted differently and handled differently than true Windows
  3765.           input fields.  One simple advantage of the JORF fields is that
  3766.           they are smaller, so you can fit up to 25 lines of prompts per
  3767.           window, instead of just 15 lines of prompts on a normal Windows
  3768.           screen. Radio Buttons and Check boxes are a hybrid, where the
  3769.           buttons are defined as child windows, but the prompts and Alt
  3770.           keys are handled entirely by JORF and not by Windows. 
  3771.  
  3772.           In addition to highlighted prompts, any menu item can be run by
  3773.           defining a Hotkey definition.  (This is an "Accelerator" in
  3774.           Windows lingo".  Just follow the menu definition by the word
  3775.           Hotkey, a colon, and the keystroke to be used.  Most of the time
  3776.           you also want to indicate the key within the menu prompt.  To
  3777.           define an accelerator in a menu, you must have at least two
  3778.           spaces between the prompt and the notation for the accelerator
  3779.           and you should right align your accelerator prompts by hand.    
  3780.  
  3781.           See the sample program MAILLIST.J printed below for an example of
  3782.           Hotkey accelerators in use.
  3783.  
  3784.                           Alt Keys within Data Entry Windows
  3785.  
  3786.           You can highlight Alt key prompts for every data entry field,
  3787.           group box, or radio button on a screen.  As a person who has
  3788.           designed such screens for almost 10 years, this ability is
  3789.           provides greatest ease of access I have ever experienced.  
  3790.  
  3791.           Any screen that grows larger than 8 prompts gets to be a pain to
  3792.           change.  Most programs start your cursor on the top, and you have
  3793.           to arrow down through the fields to get to the one you want to
  3794.           change.  In the last two years, I have done some contracted
  3795.           modifications to a program that has more than 18 fields on the
  3796.           first screen, and the most common to change are often the last
  3797.           seven.  Every time an operator needs to change this one field,
  3798.           they must press the down arrow at least 10 times!
  3799.  
  3800.           If you use your Alt keys and group boxes, you can make this
  3801.           cursor movement unnecessary.  Pressing Alt and the highlighted
  3802.           letter of an input prompt will bring you immediately to that
  3803.           prompt.  If there are too many prompts, group similar ones using
  3804.  
  3805.  
  3806.           Chapter Four - The Window Manager                              55
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.           group boxes that themselves have a highlighted letter.  You can
  3815.           see an example of that in the contact manager program CONTACT.J
  3816.  
  3817.                                    Windows Settings
  3818.  
  3819.           When a window is created using the Win:Add command, a new Win:Ptr
  3820.           structure is created.  This structure can have many elements that
  3821.           can be set using the same syntax as the commands.
  3822.  
  3823.           Simply by declaring a windowstructure label followed by a colon
  3824.           followed by a value, will set that value within the window before
  3825.           any display takes place.  
  3826.  
  3827.           In this simple example, (HAPPY.J) we can create a window with a
  3828.           yellow background and a message that says "I'm Happy"
  3829.  
  3830.                 Happy:Start
  3831.                   Win:Add
  3832.                     Attr:"Green/Yellow"
  3833.                     Msg:"I'm Happy"
  3834.                     Button:"&Ok" Row:6
  3835.                     How are we doing.
  3836.                   Return (Ok)
  3837.  
  3838.  
  3839.           Each element in the window structure has only one value, as
  3840.           opposed to a Window Command which has values for row, column,
  3841.           field name, and other routines.  The most common elements set in
  3842.           this fashion are Window Before, InpBefore and Display values,
  3843.           that define methods to execute before the window is displayed,
  3844.           before each input is entered, and before the window is
  3845.           redisplayed respectively.  The complete list of values is as
  3846.           follows:
  3847.  
  3848.           Type      Changes the color mode for the window.  You can set up
  3849.                     new color sequences in the JORF.INI file, and then
  3850.                     specify them here.  That way, each type of window in
  3851.                     your application has its own colors. Changes the
  3852.                     default colors and line style
  3853.  
  3854.           Magic     Setting Magic to False will keep the window from trying
  3855.                     to interpret magic spots (fields surrounded by {curly
  3856.                     brackets}).  Normally Magic is TRUE, and any bracket
  3857.                     expression is interpreted.
  3858.  
  3859.           Attr      Setting Attr changes the starting attribute for text
  3860.                     display in the window.  The value can be any legal
  3861.                     value documented in the Win:Attr function.
  3862.  
  3863.           FLRCO     Setting FLRCO changes the current wrap mode.  The
  3864.                     default mode is "L" for left justified text.  
  3865.  
  3866.  
  3867.           The JORF Manual (Shareware Disk Version)                       56
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.           Before    Setting Before specifies a method to be executed before
  3876.                     any data entry takes place on the window.  It can be
  3877.                     used to display additional information for the
  3878.                     operator, or to test input or display parameters.  If
  3879.                     the Before method returns FALSE, the window entry is
  3880.                     ignored.
  3881.  
  3882.           Display   Setting Display is similar to setting Before. The
  3883.                     difference is that the Before method executes before
  3884.                     any part of the window is displayed, but the Display
  3885.                     routine executes after the window box is showing.  The
  3886.                     Display routine can then add visual elements to the
  3887.                     window that are not included in buttons and fields that
  3888.                     make up the rest of the window definition.
  3889.  
  3890.           After     Setting After specifies a method to be executed when
  3891.                     the operator attempts to exit the window using the
  3892.                     Escape key or the window close button.  On text entry
  3893.                     windows, it is common to specify a method to ask
  3894.                     whether to save the changed document before exiting the
  3895.                     window.  If the After method returns False, then the
  3896.                     window remains displayed as if the operator did not
  3897.                     request an exit.
  3898.  
  3899.           InpBefore
  3900.           InpAfter  InpBefore and InpAfter may be used to specify methods
  3901.                     that must be run before and after every input field
  3902.                     (including buttons and check boxes) in the window. 
  3903.                     These methods are commonly used to lock the record, as
  3904.                     well as qualify the operator rights to change the
  3905.                     field.  If the Before method returns False, the
  3906.                     operator will not be able to change the field.  If the
  3907.                     After method returns False, the operator will not be
  3908.                     able to move to another field (presumably until the
  3909.                     operator corrects the field value.)
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.           Chapter Four - The Window Manager                              57
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.                                         Array
  3938.  
  3939.  
  3940.           Command   Array:""
  3941.  
  3942.           Purpose   A pick list of array elements.  
  3943.  
  3944.           Options   Row:10              Set Row
  3945.  
  3946.                     Col:10              Set Column
  3947.  
  3948.                     Wid:10              Set Width of List
  3949.  
  3950.                     Len:3               Set Length of List
  3951.  
  3952.                     After:"Expr"        Expression is executed after list..
  3953.  
  3954.  
  3955.                     Before:"Expr"       Expression is executed. If false,
  3956.                                         the operator cannot pick from list.
  3957.  
  3958.  
  3959.                     Field:"Fldname"     Command to execute for Next Record
  3960.  
  3961.                     Choice:"Field"      Command to execute for Previous
  3962.                                         Record
  3963.  
  3964.           Defaults  Row            One row below previous command.  If the
  3965.                                    previous command is a Group Box, then
  3966.                                    Row, Col, Wid and Len default to the
  3967.                                    inside dimensions of the box.
  3968.  
  3969.                     Col            Same column as previous command.
  3970.  
  3971.                     Wid            30
  3972.  
  3973.                     Len            1
  3974.  
  3975.           Highlight Arrays are highlighted like menus.  No cursor is
  3976.                     displayed, even when the array has focus.
  3977.  
  3978.           See Also  List.
  3979.  
  3980.           Notes     This command works like List, but operates only on
  3981.                     arrays and is much faster.  The fact that it works on
  3982.                     arrays limits the size of the data you can edit, but
  3983.                     this is a good vehicle for pick lists up to a thousand
  3984.                     elements.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.           The JORF Manual (Shareware Disk Version)                       58
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.           Example   The DirList.J program creates a "Dialog Directory list"
  3999.                     and returns the selected file.  Here is the DirList by
  4000.                     itself.  The TextEdit.J program uses it to select a
  4001.                     file to edit.  This program is compiled into the
  4002.                     interpreter as the DirList:GetFile() function.
  4003.  
  4004.           Class:DirList                   | Class Definition
  4005.             Name                          | File Name
  4006.             Path                          | File Path
  4007.             WildCard                      | Wildcard for directory
  4008.             ExclusionList                 | Extension Exclusion List
  4009.             FileArray                     | Array of files on this path
  4010.             DirArray                      | Array of other paths
  4011.  
  4012.           DirList:Start                   | FOR TESTING:  Start routine
  4013.             New (FileName)
  4014.             FileName = DirList:GetFile("*.*",Null)
  4015.             Msg:Add
  4016.               File name is {FileName}
  4017.             Return (Ok)
  4018.  
  4019.           DirList:Cancel(List)            | Routine to Cancel data entry
  4020.             List->Name=Null               | Signal that we canceled
  4021.             Return(Null)                  | Returning Null will finish input
  4022.  
  4023.           DirList:Done(List,Name)         | Routine to finish data entry
  4024.             If (Str:In(List->Name,"*") Or Str:In(List->Name,"?"))
  4025.               List->WildCard  = List->Name
  4026.               List->FileArray = DirList:FileArray(List->Wildcard, List->Exclusionlist)
  4027.               Kbd:Put("Home_Key")       | Stuff home key
  4028.               Win:Dsp              | Redisplay (including arrays)
  4029.               Return (Ok)
  4030.  
  4031.             If (List->Name==Null)         | If name is still null display message
  4032.               Msg:Add
  4033.                 Please select a file
  4034.                 name or "Cancel".
  4035.               Return (Ok)                 | Returning Ok will continue input
  4036.             Return (Null)                 | Returning Null will finish input
  4037.  
  4038.           DirList:FileArray(WildCard,Exclusionlist)  | Read a file array
  4039.             New (Array)
  4040.             If (WildCard!="SUBDIR")
  4041.               Win:Add ('Reading')
  4042.                 Reading directory
  4043.             Array = Arr:Dir (WildCard, ExclusionList, 12)
  4044.             Return (Array)
  4045.  
  4046.           DirList:GetFile(WildCard,ExclusionList)
  4047.             New (OrigPath, DirList:List, DirChoice, FileChoice)
  4048.  
  4049.  
  4050.           Chapter Four - The Window Manager                              59
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.             | Initalize values
  4059.             OrigPath            = File:ChDir()
  4060.             List->Path          = OrigPath
  4061.             List->WildCard      = WildCard
  4062.             List->ExclusionList = Exclusionlist
  4063.             List->FileArray     = DirList:FileArray(List->Wildcard, List->Exclusionlist)
  4064.             List->DirArray      = DirList:FileArray("SUBDIR")
  4065.  
  4066.             Event:Add(Null)               | Block prior keystroke events
  4067.             Win:Add ("Get File Name", 0, 0, 10, 56, Here)
  4068.  
  4069.               | Input File Name
  4070.               Input:"File&name:  ",  Wid:24, Row:2, Col:3, Field:"List->Name"
  4071.  
  4072.               | Files array with a group box around
  4073.               Group:"&Files",       Row:6, Col:2, Wid:16, Len:10
  4074.               Array:"", Field:"List->FileArray",
  4075.                         Choice:"FileChoice",
  4076.                         Action:"DirList:NewName(List,List->FileArray[FileChoice])"
  4077.  
  4078.               | Directories array with a group box around
  4079.               Group:"&Directories", Row:6, Col:22, Wid:16, Len:10
  4080.               Array:"", Field:"List->DirArray",
  4081.                         Choice:"DirChoice"
  4082.                         Action:"DirList:NewDir(List,List->DirArray[DirChoice])"
  4083.  
  4084.               | Input File Path
  4085.               Input:"Directory: ",   Wid:24, Row:4, Col:3, Field:"List->Path"
  4086.                       After:"DirList:NewDir(List,List->Path)"
  4087.  
  4088.               | Two buttons
  4089.               Button:"   &Ok   ", Row:1, Col:42, Wid:14
  4090.                 Action:"DirList:Done(List,List->FileArray[FileChoice])"
  4091.               Button:" &Cancel ", Row:4, Col:42, Wid:14
  4092.                 Action:"DirList:Cancel(List)"
  4093.  
  4094.             If (File:ChDir(OrigPath))
  4095.               If (List->Name)
  4096.                 If (Str:At(List->Path,Str:Len(List->Path),1)=='\')
  4097.                 Return (List->Path+List->Name)
  4098.                 Return (List->Path+'\'+List->Name)
  4099.             Return (Null)
  4100.  
  4101.           DirList:NewDir(List,Path)       | Routine to set a new path
  4102.             If (File:Chdir(Path))         | Change to the new path
  4103.               List->Path = File:ChDir()   | Reset path name
  4104.               List->Name = Null           | Set file name to null
  4105.               | Re-read file array
  4106.               List->FileArray = DirList:FileArray(List->Wildcard, List->Exclusionlist)
  4107.               | Re-Read directory array - special argument "SUBDIR" does this
  4108.               List->DirArray  = DirList:FileArray("SUBDIR")
  4109.               Win:Dsp                     | Redisplay Window
  4110.  
  4111.           The JORF Manual (Shareware Disk Version)                       60
  4112.  
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.             Return(Ok)                    | Returning Ok continues input
  4120.  
  4121.           DirList:NewName(List,Name)      | Routine to set a new name
  4122.             List->Name = Word:At(Name,1)  | Set the name (Easy!)
  4123.             Win:Dsp                       | Redisplay the screen
  4124.             Kbd:Put("Home_Key")         | And go back to file name
  4125.             Return(Ok)                    | Returning OK will continue input
  4126.  
  4127.  
  4128.  
  4129.  
  4130.  
  4131.  
  4132.  
  4133.  
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.           Chapter Four - The Window Manager                              61
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.                                         ChBox
  4182.  
  4183.  
  4184.           Command   ChBox:"&Prompt"
  4185.  
  4186.           Purpose   A Check Box.  
  4187.  
  4188.           Options   Row:10              Set row.
  4189.  
  4190.                     Col:10              Set column.
  4191.  
  4192.                     Wid:20              Set width of highlighted prompt.
  4193.  
  4194.                     Check:"Expr"        Box is checked if Expression is
  4195.                                         True.
  4196.  
  4197.                     Action:"Expr"       Expression is executed when box is
  4198.                                         selected. 
  4199.  
  4200.                     Before:"Expr"       Expression is executed. If false
  4201.                                         box cannot be selected.
  4202.  
  4203.           Defaults  Row            One row below previous command.
  4204.  
  4205.                     Col            Same column as previous command.  If
  4206.                                    previous command as Group, column is
  4207.                                    incremented to be inside of group box.
  4208.  
  4209.                     Wid            Prompt width.
  4210.  
  4211.           Highlight Prompt is highlighted when box is selected.  Pressing
  4212.                     Enter will check the box.  Pressing the space bar will
  4213.                     advance the cursor without checking the box. 
  4214.  
  4215.           See Also  Radio
  4216.  
  4217.           Notes     Check boxes are boxes that contain an X if selected,
  4218.                     and are empty if not selected.  They are commonly used
  4219.                     for selections that are cumulative.  Radio buttons
  4220.                     should be used when selections are mutually exclusive. 
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.           The JORF Manual (Shareware Disk Version)                       62
  4234.  
  4235.  
  4236.  
  4237.  
  4238.  
  4239.  
  4240.  
  4241.  
  4242.                                         Button
  4243.  
  4244.  
  4245.  
  4246.           Command   Button:"&Prompt"
  4247.  
  4248.           Purpose   A Button.  
  4249.  
  4250.           Options   Row:10              Set Row
  4251.  
  4252.                     Col:10              Set Column
  4253.  
  4254.                     Wid:10              Set Width of Button
  4255.  
  4256.                     Len:3               Set Length of Button
  4257.  
  4258.                     Action:"Expr"       Expression is executed when box is
  4259.                                         selected. 
  4260.  
  4261.                     Before:"Expr"       Expression is executed. If false
  4262.                                         box cannot be selected.
  4263.  
  4264.           Defaults  Row            One row below previous command.
  4265.  
  4266.                     Col            Same column as previous command.  If
  4267.                                    previous command as Group, column is
  4268.                                    incremented to be inside of the group
  4269.                                    box.
  4270.  
  4271.                     Wid            Prompt width plus two spaces on each
  4272.                                    side.
  4273.  
  4274.                     Len            3.
  4275.  
  4276.           Highlight In the DOS version, the button is highlighted. 
  4277.                     Pressing Enter will select the button.  Pressing the
  4278.                     space bar will advance the cursor without selecting the
  4279.                     button.   
  4280.  
  4281.           Notes     Buttons are used to complete screens or to select major
  4282.                     options.  They are not generally used for data entry
  4283.                     purposes.  The minimum length for a button in JORF is 3
  4284.                     lines.  You cannot create "little" buttons.  
  4285.  
  4286.           Example
  4287.  
  4288.           Ascii:Start
  4289.             Win:Add("ASCII TABLE", 4, 4, 19, 62, Here)
  4290.               Display:"Ascii:Show(0)"
  4291.               Marker:"Button"
  4292.               Button:"&Upper ASCII", Row:17 Col:1  Wid:30 Action:"Ascii:Show(128)"
  4293.  
  4294.           Chapter Four - The Window Manager                              63
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.               Marker:"Exit"
  4303.               Button:"E&xit ", Row:17 Col:33 Wid:30 Action:"Jorf:Exit()"
  4304.             Return
  4305.  
  4306.           Ascii:Show(Base)
  4307.             New (Char)
  4308.  
  4309.             Win:Attr("Lo")
  4310.             Move:To(1,1)
  4311.  
  4312.             | Display 128 Ascii characters
  4313.             For (Char = Base Thru 127+Base)
  4314.               Str:Put(To:Str(Char,"000 "))
  4315.               Char:Put(Char)
  4316.               If ((Char %8)==7)
  4317.                 Str:PutLine()
  4318.               Else
  4319.                 Str:Put("   ")
  4320.             Win:Attr("No")
  4321.  
  4322.             | Change button to be the opposite of what is showing
  4323.             If (Base==0)
  4324.               Win:Chg("Button",17,1,19,33)
  4325.                 Button:"&Upper ASCII", Row:17 Col:1 Wid:30 Action:"Ascii:Show(128)"
  4326.             Else
  4327.               Win:Chg("Button",17,1,19,33)
  4328.                 Button:"&Lower ASCII", Row:17 Col:1 Wid:30 Action:"Ascii:Show(0)"
  4329.  
  4330.             Return (Ok)
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.           The JORF Manual (Shareware Disk Version)                       64
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.  
  4364.                                         Group
  4365.  
  4366.  
  4367.  
  4368.           Command   Group:"&Prompt"
  4369.  
  4370.           Purpose   A Group Box.  
  4371.  
  4372.           Options   Row:10              Set Row
  4373.  
  4374.                     Col:10              Set Column
  4375.  
  4376.                     Wid:40              Set Width of Box
  4377.  
  4378.                     Len:6               Set Length of Box
  4379.  
  4380.           Defaults  Row            One row below previous command.
  4381.  
  4382.                     Col            Same column as previous command.  
  4383.  
  4384.           Highlight Group boxes can never be selected, and are never
  4385.                     highlighted.  If a group box has an Alt key letter, and
  4386.                     that key is pressed, the first field within the group
  4387.                     box is highlighted. 
  4388.  
  4389.           Notes     A Group box is a single line box that surrounds one or
  4390.                     more data entry fields.  They are commonly used for
  4391.                     surrounding related fields, and for surrounding
  4392.                     multiple line text fields. 
  4393.  
  4394.                     A feature of the group boxes in JORF is to be able to
  4395.                     use an Alt key to move to the first field of the box.
  4396.  
  4397.           Example   This is the masin screen from the MAILLIST.J sample
  4398.                     program.
  4399.  
  4400.           MailList:Start                     | Little Mail List Program
  4401.             New (Contact:Con)                | Create Contact Structure
  4402.             Jorf:File ("MAILLIST.JCM",Here)  | Set Database File
  4403.             Event:Add ("MailKey","Key",Here) | Set MailKey as a keystroke handler
  4404.             Mem:Ptr->IndexName = "FullName"  | Index Name
  4405.  
  4406.             | The main screen with menu options
  4407.             Win:Add ("Josephine's Mail List Manager", 2, 2, 22, 78, Here)
  4408.               Menu:"&File"
  4409.                 Menu:"&About            "  Action:"MailList:About"
  4410.                 Menu:
  4411.                 Menu:"&Rebuild        ",   Action:"Jorf:Rebuild"
  4412.                 Menu:
  4413.                 Menu:"E&xit        Alt-X", Action:"MailKey:Esc_Key"
  4414.  
  4415.  
  4416.           Chapter Four - The Window Manager                              65
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.               Menu:"&Edit"
  4425.                 Menu:"&Add     Alt-A", Action:"MailList:Add(Con)"    HotKey:"Alt_A_Key"
  4426.                 Menu:"&Change  Alt-C", Action:"MailList:Change(Con)"
  4427.                 Menu:"&Delete  Alt-D", Action:"MailList:Delete(Con)" HotKey:"Alt_D_Key"
  4428.  
  4429.               Menu:"&Search",
  4430.                 Menu:"&Name       ",  Action:"MailList:KeySearch (Con, 'FullName' )
  4431.                 Menu:"&Company    ",  Action:"MailList:KeySearch (Con, 'Company'  )
  4432.                 Menu:"&Last Name  ",  Action:"MailList:KeySearch (Con, 'LastName' )
  4433.                 Menu:"&Phone      ",  Action:"MailList:KeySearch (Con, 'WorkPhone')
  4434.                 Menu:"&Zip        ",  Action:"MailList:KeySearch (Con, 'ZipCode'  )
  4435.  
  4436.               Menu:"&Reports"
  4437.                 Menu:"&Mail List    ", Action:"MailList:List()"
  4438.                 Menu:"&This Contact ", Action:"MailList:PrintData(Con)"
  4439.                 Menu:"&Lotsa Labels ", Action:"MailList:ContinLabels(Con,'All')"
  4440.                 Menu:"&One Label",     Action:"MailList:ContinLabels(Con,'One')"
  4441.  
  4442.               InpBefore:"MailList:Lock(Con)"
  4443.               Group:"&Browse List", Row:1 Col:41, Len:6, Wid:36
  4444.               List:""
  4445.                 Field:"Con"
  4446.                 Next:"MailList:NextRecord(Con,'Next')"
  4447.                 Prev:"MailList:NextRecord(Con,'Prev')"
  4448.                 Show:"MailList:Show(Con)"
  4449.                 Before:"MailList:Write()"
  4450.                 Display:"(Mem:Ptr->Locked==Null)"
  4451.  
  4452.               Group:"&Contact Name and Address", Row:1, Col:1, Wid:38, Len:6
  4453.               Input:"Name   ",    Wid:30, Field:"Con->FullName"
  4454.                 After:"MailList:SplitName(Con)"
  4455.               Input:"Company", Wid:30,    Field:"Con->Company"
  4456.               Input:"Address", Wid:30,    Field:"Con->Addr1"
  4457.               Input:"       ", Wid:30,    Field:"Con->Addr2"
  4458.               Input:"       ", Wid:30,    Field:"Con->Addr3"
  4459.                 After:"MailList:ZipCode(Con)"
  4460.  
  4461.               Group:"Mail List Fields"
  4462.                 Row:9  Col:1  Len:11  Wid:76
  4463.               Input:"&Work Phone" Field:"Con->WorkPhone"
  4464.                 Row:10  Col:2  Wid:20
  4465.               Input:"&Home Phone"  Field:"Con->Homephone"
  4466.                 Row:11  Col:2  Wid:20
  4467.               Input:"Fax &Phone " Field:"Con->FaxPhone"
  4468.                 Row:12  Col:2  Wid:20
  4469.               Input:"Birthda&y  " Field:"Con->BirthDay"
  4470.                 Row:13  Col:2  Wid:20
  4471.               Input:"C&omment   "  Field:"Con->Comment"
  4472.                 Row:15  Col:2  Wid:50
  4473.               Input:"&Last Name " Field:"Con->LastName"
  4474.                 Row:10  Col:35  Wid:14
  4475.               Input:"Dear      " Field:"Con->Dear"
  4476.  
  4477.           The JORF Manual (Shareware Disk Version)                       66
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.                 Row:11  Col:35  Wid:14
  4486.               Input:"Zip Code  " Field:"Con->Zipcode"
  4487.                 Row:12  Col:35  Wid:14
  4488.               Radio:"Fr&iend"
  4489.                 Check:"Con->Type=='Friend'"
  4490.                 Action:"Con->Type='Friend'"
  4491.                 UnAction:"Con->Type= Null"
  4492.                 Row:10  Col:62
  4493.               Radio:"Fa&mily"
  4494.                 Check:"Con->Type=='Family'"
  4495.                 Action:"Con->Type='Family'"
  4496.                 UnAction:"Con->Type= Null"
  4497.                 Row:11  Col:62
  4498.               Radio:"Clien&t"
  4499.                 Check:"Con->Type=='Client'"
  4500.                 Action:"Con->Type='Client'"
  4501.                 UnAction:"Con->Type= Null"
  4502.                 Row:12  Col:62
  4503.               Radio:"&Vendor"
  4504.                 Check:"Con->Type=='Vendor'"
  4505.                 Action:"Con->Type='Vendor'"
  4506.                 UnAction:"Con->Type= Null"
  4507.                 Row:13  Col:62
  4508.               HLine:"&Notes"
  4509.                 Row:16  Col:2  Len:1  Wid:76
  4510.               Text:"" Field:"Con->Notes"
  4511.                 Row:17  Col:2  Len:4  Wid:76
  4512.             Return (Ok)                         | That is all, Folks!
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538.           Chapter Four - The Window Manager                              67
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.                                         Input
  4548.  
  4549.  
  4550.           Command   Input:"&Prompt"
  4551.  
  4552.           Purpose   An Input Field.  
  4553.  
  4554.           Options   Row:10              Set Row
  4555.  
  4556.                     Col:10              Set Column
  4557.  
  4558.                     Wid:10              Set Width of Data Entry
  4559.  
  4560.                     Len:3                    Set Length of Data Entry
  4561.  
  4562.                     After:"Expr"        Expression is executed after
  4563.                                         input.. 
  4564.  
  4565.                     Before:"Expr"       Expression is executed. If false
  4566.                                         input is skipped. 
  4567.  
  4568.                     Field:"Value"       Field Value to be entered. 
  4569.  
  4570.                     Type:"DType"        Set data type for automatic
  4571.                                         conversion.  "DType" can be "Date"
  4572.                                         or "Number".
  4573.  
  4574.                     Format:"##,###.00"  If Type is "Number", numeric format
  4575.                                         for display.  Will be unformatted
  4576.                                         for entry.
  4577.  
  4578.           Defaults  Row            One row below previous command.
  4579.  
  4580.                     Col            Same column as previous command.  If
  4581.                                    previous command as Group, column is
  4582.                                    incremented to be inside the group box.
  4583.  
  4584.                     Wid            30
  4585.  
  4586.                     Len            1
  4587.  
  4588.           Highlight Input fields are highlighted with attribute 4 when not
  4589.                     active, and attribute 5 when they are being edited. 
  4590.                     Also, the cursor is displayed when they are being
  4591.                     edited.  The prompt is never highlighted.
  4592.  
  4593.           See Also  Text.
  4594.  
  4595.           Notes     Input is used to enter single line prompts and small
  4596.                     multi line prompts.  Data entry fields are highlighted
  4597.                     both during entry and when displayed on the screen. 
  4598.  
  4599.           The JORF Manual (Shareware Disk Version)                       68
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.           Example   This program, Payment.J contains both Type and Format
  4608.                     commands.  For extra fun, try this one with "Set
  4609.                     Decimal=," (comma decimal) in your INI file.
  4610.  
  4611.           Class:Payment (Amt,Yrs,Intr,Pmt,Pmt50,Yrs50)
  4612.  
  4613.           Payment:Start
  4614.             New (Payment:Pmt)
  4615.             Win:Add ("Loan Payment Calculator",5,20)
  4616.               String:"Calculate your loan payment amount and years"
  4617.               String:"to pay if you added just $50 to the payment."
  4618.               String:
  4619.               String:"Press the TAB key to get from one field to"
  4620.               String:"the next. ENTER will end the program."
  4621.  
  4622.               Input:"&Loan Amount         ", Row:7 Col:5 Wid:14
  4623.                 Field:"Pmt->Amt", After:"Payment:Calc(Pmt)"
  4624.                 Format:"###,###,###.00", Type:"Numeric"
  4625.  
  4626.               Input:"&Years to Pay        ", Row:8 Col:5 Wid:3
  4627.                 Field:"Pmt->Yrs", After:"Payment:Calc(Pmt)"
  4628.                 Format:"###", Type:"Numeric"
  4629.  
  4630.               Input:"&Percent Interest    ", Row:9 Col:5 Wid:8
  4631.                 Field:"Pmt->Intr", After:"Payment:Calc(Pmt)"
  4632.                 Format:"#0.0000%", Type:"Numeric"
  4633.  
  4634.               Input:"Payment             ", Row:10 Col:5 Wid:14
  4635.                 Field:"Pmt->Pmt", Before:"Return(Null)"
  4636.                 Format:"###,###,###.00", Type:"Numeric"
  4637.  
  4638.               Input:"Adding just $50     ", Row:12 Col:5 Wid:14
  4639.                 Field:"Pmt->Pmt50", Before:"Return(Null)"
  4640.                 Format:"###,###,###.00", Type:"Numeric"
  4641.  
  4642.               Input:"Reduces the years to"  Row:13 Col:5 Wid:3
  4643.                 Field:"Pmt->Yrs50", Before:"Return(Null)"
  4644.                 Format:"###", Type:"Numeric"
  4645.  
  4646.               Button:"    &Done    ", Row:15, Col:16
  4647.             Return(Ok)
  4648.  
  4649.           Payment:Calc(Pmt)
  4650.             New (Periods,Per_Intr,Payment,Months50)
  4651.             Pmt->Pmt = 0
  4652.             If (Pmt->Intr > 0 And Pmt->Yrs > 0)
  4653.               Periods    = Pmt->Yrs*12
  4654.               Per_Intr   = Pmt->Intr/12/100
  4655.               Payment    = (Pmt->Amt*Per_Intr) / (1-Num:Pow(1+Per_Intr,(-Periods)))
  4656.               Payment    = Num:Int((Payment+.005)*100)/100
  4657.               Pmt->Pmt   = Payment
  4658.               Pmt->Pmt50 = Payment+50
  4659.  
  4660.           Chapter Four - The Window Manager                              69
  4661.  
  4662.  
  4663.  
  4664.  
  4665.  
  4666.  
  4667.  
  4668.               Months50   = Num:Log(Pmt->Pmt50/(Pmt->Pmt50-Pmt->Amt*Per_Intr))
  4669.               Months50   = Months50/Num:Log(1+Per_Intr)
  4670.               Pmt->Yrs50 = Num:Int((Months50/12)*10)/10
  4671.               Win:Dsp
  4672.             Return (Ok)
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702.  
  4703.  
  4704.  
  4705.  
  4706.  
  4707.  
  4708.  
  4709.  
  4710.  
  4711.  
  4712.  
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718.  
  4719.  
  4720.  
  4721.           The JORF Manual (Shareware Disk Version)                       70
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.                                          List
  4731.  
  4732.  
  4733.           Command   List:""
  4734.  
  4735.           Purpose   A pick list of records.  
  4736.  
  4737.           Options   Row:10         Set Row
  4738.  
  4739.                     Col:10         Set Column
  4740.  
  4741.                     Wid:10         Set Width of List
  4742.  
  4743.                     Len:3          Set Length of List
  4744.  
  4745.                     After:"Expr"   Expression is executed after list.. 
  4746.  
  4747.                     Before:"Expr"  Expression is executed. If false cannot
  4748.                                    pick from list. 
  4749.  
  4750.                     Next:"Expr"    Command to execute for Next Record
  4751.  
  4752.                     Prev:"Expr"    Command to execute for Prev Record
  4753.  
  4754.                     Show:"Expr"    Command to execute to display entry
  4755.  
  4756.  
  4757.           Defaults  Row            One row below previous command.  If the
  4758.                                    previous command is a Group Box, then
  4759.                                    Row, Col, Wid and Len default to the
  4760.                                    inside dimensions of the box.
  4761.  
  4762.                     Col            Same column as previous command.
  4763.  
  4764.                     Wid            30
  4765.  
  4766.                     Len            1
  4767.  
  4768.  
  4769.           Highlight Lists are highlighted like menus.  When the list
  4770.                     position is changed using the mouse or arrow keys, the
  4771.                     screen is automatically redisplayed.  No cursor is
  4772.                     displayed, even when the list has focus.
  4773.  
  4774.           See Also  Array.
  4775.  
  4776.           Notes     This has got to be my favorite window feature.  This
  4777.                     command is used to display information that is
  4778.                     contained in different records, where an Array list can
  4779.                     only display arrays.  Since you control the next and
  4780.  
  4781.  
  4782.           Chapter Four - The Window Manager                              71
  4783.  
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790.                     prev functions, it is easy to make the list indexed, to
  4791.                     filter it, and to format the displayed text. 
  4792.  
  4793.                     Lists are relatively slow, since it takes several
  4794.                     record reads to display several records.  For this
  4795.                     reason, you should keep your lists as short as you can,
  4796.                     since this limits the number of records required for a
  4797.                     display operation.   
  4798.  
  4799.           Example   See the MailList.J sample program, especially what
  4800.                     happens when you change your index to the Zip code
  4801.                     index.
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825.  
  4826.  
  4827.  
  4828.  
  4829.  
  4830.  
  4831.  
  4832.  
  4833.  
  4834.  
  4835.  
  4836.  
  4837.  
  4838.  
  4839.  
  4840.  
  4841.  
  4842.  
  4843.           The JORF Manual (Shareware Disk Version)                       72
  4844.  
  4845.  
  4846.  
  4847.  
  4848.  
  4849.  
  4850.  
  4851.  
  4852.                                         Marker
  4853.  
  4854.  
  4855.  
  4856.           Command   Marker:"Markername"
  4857.  
  4858.           Purpose   Mark a section of input fields and buttons for later
  4859.                     replacement using Win:Chg.
  4860.  
  4861.           Options   None
  4862.  
  4863.           See Also  Win:Chg.
  4864.  
  4865.           Notes     More sophisticated data entry windows contain buttons
  4866.                     and fields that change according to what is entered on
  4867.                     the screen.  The way to make this happen in JORF land
  4868.                     is to set markers around those fields, and then use
  4869.                     Win:Chg to set new fields in their place.  
  4870.  
  4871.                     Markers do not display, cannot be highlighted, and
  4872.                     cannot have After or Action clauses.  Before and
  4873.                     Display clauses probably work, however, and tagging
  4874.                     them to a non-displaying element allows you to closely
  4875.                     control when these operations are performed.
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.  
  4892.  
  4893.  
  4894.  
  4895.  
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.  
  4902.  
  4903.  
  4904.           Chapter Four - The Window Manager                              73
  4905.  
  4906.  
  4907.  
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.                                          Menu
  4914.  
  4915.  
  4916.  
  4917.           Command   Menu:"&Prompt"
  4918.  
  4919.           Purpose   A Menu Bar or Menu Line.  
  4920.  
  4921.           Options   Action:"Expr"       Expression to execute when
  4922.                                         selected. 
  4923.  
  4924.                     Hotkey:"Keystroke"  Hotkey accelerator
  4925.  
  4926.                       Menu:"&Prompt"    (Indented) SubMenu Options
  4927.  
  4928.  
  4929.           See Also  MLine.
  4930.  
  4931.           Notes     The Menu command is used for Menu bars and associated
  4932.                     pull down menu boxes.  Each menu command contains
  4933.                     either an Action, or it has indented sub-menu commands
  4934.                     below.  A menu option cannot have both.
  4935.  
  4936.                     The top level menu is assumed to be a menu bar on the
  4937.                     top of the current window.  To force top level menu to
  4938.                     be menu lines, use MLine.  All indented sub-menu
  4939.                     commands are menu lines, even when declared using the
  4940.                     Menu command. 
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.  
  4959.  
  4960.  
  4961.  
  4962.  
  4963.  
  4964.  
  4965.           The JORF Manual (Shareware Disk Version)                       74
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.  
  4973.  
  4974.                                         MLine
  4975.  
  4976.  
  4977.           Command   MLine:"&Prompt"
  4978.  
  4979.           Purpose   A Menu Line.  
  4980.  
  4981.           Options   Action:"Expr"       Expression to execute when
  4982.                                         selected. 
  4983.  
  4984.                     Hotkey:"Keystroke"  Hotkey accelerator
  4985.  
  4986.                       Menu:"&Prompt"    (Indented) SubMenu Options
  4987.  
  4988.           See Also  Menu.
  4989.  
  4990.           Notes     The MLine command is used to force a menu to use menu
  4991.                     lines, even when it is a top level menu.  For Menu
  4992.                     bars, use Menu. 
  4993.  
  4994.                     I don't think the use of MLine is CUA compliant, since
  4995.                     no CUA screen uses a menu-lines as a top level menu
  4996.                     (i.e. the whole window contains one menu.
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.  
  5024.  
  5025.  
  5026.           Chapter Four - The Window Manager                              75
  5027.  
  5028.  
  5029.  
  5030.  
  5031.  
  5032.  
  5033.  
  5034.  
  5035.                                         Prompt
  5036.  
  5037.  
  5038.  
  5039.           Command   Prompt:"&Prompt"
  5040.  
  5041.           Purpose   A Highlightable Prompt.  
  5042.  
  5043.           Options   Row:10         Set Row
  5044.  
  5045.                     Col:10         Set Column
  5046.  
  5047.                     Wid:30         Set Width of highlight area. 
  5048.  
  5049.                     Action:"Expr"  Executes Expression when selected.
  5050.  
  5051.                     Before:"Expr"  Executes Expression, If false prompt
  5052.                                    cannot be selected.
  5053.  
  5054.           Defaults  Row            One row below previous command.  If used
  5055.                                    in brackets in text, defaults to current
  5056.                                    text position.
  5057.  
  5058.                     Col            Same column as previous command.  If
  5059.                                    previous command as Group, column is
  5060.                                    incremented to be inside of the group
  5061.                                    box.  If used in brackets in text,
  5062.                                    defaults to current text position.
  5063.  
  5064.           Highlight Prompts are highlighted when they are active.  Pressing
  5065.                     Enter when highlighted will select the prompt. 
  5066.                     Pressing the space bar will move the cursor downward. 
  5067.  
  5068.           See Also  String.
  5069.  
  5070.           Notes     Prompts are used primarily for Hypertext.  In this
  5071.                     case, they are commonly defined within the text in
  5072.                     curly brackets.  For prompts that are never
  5073.                     highlighted, like screen subtitles or text, see String.
  5074.  
  5075.                     Prompts may also be aligned in a row, producing a menu
  5076.                     bar menu in the middle of a text screen.  You can see
  5077.                     an example of this usage in the opening screen of The
  5078.                     JORF Tutorial, where the hypertext options are a
  5079.                     "Prompt Menu" 
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.           The JORF Manual (Shareware Disk Version)                       76
  5088.  
  5089.  
  5090.  
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096.           Example   An enterprising user gave me this program (with a bug
  5097.                     to fix) and I really like it.  Try DOS.J.
  5098.  
  5099.           Dos:Start
  5100.             Win:Add("Jo's DOS Function Utility", 0, 0, 20, 44)
  5101.              This program allows the user to &
  5102.              select special DOS commands.
  5103.  
  5104.              Place your mouse over the desired &
  5105.              selection and click the Left Mouse &
  5106.              Button or you may use the up and down &
  5107.              arrow keys to select the desired command.
  5108.  
  5109.              {Group:"DOS Commands" Row:9 Col:5 Len:10 Wid:30}
  5110.               {Prompt:"&Memory Stats     " Row:11 Col:7 Wid:25 Action:"Dos:Cmd('Mem')"}
  5111.               {Prompt:"&Command Shell    " Row:12 Col:7 Wid:25 Action:"Dos:Cmd('Shell')"}
  5112.               {Prompt:"Directory by &Date" Row:13 Col:7 Wid:25 Action:"Dos:Cmd('DirDate')"}
  5113.               {Prompt:"Directory by &Size" Row:14 Col:7 Wid:25 Action:"Dos:Cmd('DirSize')"}
  5114.               {Prompt:"&Type in a Command" Row:15 Col:7 Wid:25 Action:"Dos:Cmd('TypeIt')"}
  5115.               {Prompt:"&Windows Program  " Row:16 Col:7 Wid:25 Action:"Dos:Cmd('Windows')"}
  5116.               {Prompt:"E&xit             " Row:18 Col:7 Wid:25 Action:"Return(Null)"}
  5117.             Return (Ok)
  5118.  
  5119.           Dos:Cmd(Action)
  5120.             New (Command, Flags, Message)
  5121.             Switch (Action)
  5122.               Case 'Mem'
  5123.                 Command = "Mem /c | More"
  5124.                 Flags = "CP"
  5125.               Case 'Shell'
  5126.                 Command = Null
  5127.                 Flags = "C"
  5128.                 Message = "Type 'EXIT' to return to JORF"
  5129.               Case 'DirDate'
  5130.                 Command = "Dir /o-d | More"
  5131.                 Flags = "CP"
  5132.                 Message = "Sorting . . ."
  5133.               Case 'DirSize'
  5134.                 Command = "Dir /o-s | More"
  5135.                 Flags = "CP"
  5136.                 Message = "Sorting . . ."
  5137.               Case 'TypeIt'
  5138.                 Win:Add
  5139.                   Input:"Command to execute:", Field:"Command"
  5140.                 If (Kbd:Got=='Esc_Key')
  5141.                   Return
  5142.                 Flags = "C"
  5143.               Case 'Windows'
  5144.                 If (Jorf:Info("Windows")==False)
  5145.                   Msg:Add
  5146.                     This option only works in the &
  5147.  
  5148.           Chapter Four - The Window Manager                              77
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  
  5156.                     Windows version of the JORF interpreter.
  5157.                   Return
  5158.                 Win:Add
  5159.                   Input:"Windows program:", Field:"Command"
  5160.                 If (Kbd:Got=='Esc_Key')
  5161.                   Return
  5162.                 Flags = "W"
  5163.               Else
  5164.                 Msg:Add
  5165.                   Illegal DOS Command "{Action}".
  5166.                 Return (Ok)
  5167.             Jorf:System (Command, Flags, Message)
  5168.             Return (Ok)
  5169.  
  5170.  
  5171.  
  5172.  
  5173.  
  5174.  
  5175.  
  5176.  
  5177.  
  5178.  
  5179.  
  5180.  
  5181.  
  5182.  
  5183.  
  5184.  
  5185.  
  5186.  
  5187.  
  5188.  
  5189.  
  5190.  
  5191.  
  5192.  
  5193.  
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.  
  5204.  
  5205.  
  5206.  
  5207.  
  5208.  
  5209.           The JORF Manual (Shareware Disk Version)                       78
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.                                         Radio
  5219.  
  5220.  
  5221.           Command   Radio:"&Prompt"
  5222.  
  5223.           Purpose   A Radio Button.  
  5224.  
  5225.           Options   Row:10         Set row.
  5226.  
  5227.                     Col:10         Set column.
  5228.  
  5229.                     Wid:20         Set width of highlighted prompt.
  5230.  
  5231.                     Check:"Expr"   Box is checked if Expression is True.
  5232.  
  5233.                     Action:"Expr"  Expression is executed when box is
  5234.                                    selected. 
  5235.  
  5236.                     Before:"Expr"  Expression is executed. If false box
  5237.                                    cannot be selected.
  5238.  
  5239.           Defaults  Row            One row below previous command.
  5240.  
  5241.                     Col            Same column as previous command.  If
  5242.                                    previous command as Group, column is
  5243.                                    incremented to be inside the group box.
  5244.  
  5245.                     Wid            Prompt width
  5246.  
  5247.           Highlight Prompt is highlighted when box is selected.  Pressing
  5248.                     Enter will check the box.  Pressing the space bar will
  5249.                     advance the cursor without checking the box. 
  5250.  
  5251.           See Also  ChBox
  5252.  
  5253.           Notes     Radio buttons are circular boxes that contain a dot if
  5254.                     selected and are empty if not selected.  They are
  5255.                     commonly used for selections that are exclusive.  Use
  5256.                     Check boxes for selections that are cumulative. 
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.           Chapter Four - The Window Manager                              79
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.                                         String
  5280.  
  5281.  
  5282.           Command   String:"&Prompt"
  5283.  
  5284.           Purpose   An unhighlighted prompt. 
  5285.  
  5286.           Options   Row:10         Set Row
  5287.  
  5288.                     Col:10         Set Column
  5289.  
  5290.           Defaults  Row            One row below previous command.  If used
  5291.                                    in brackets in text, defaults to current
  5292.                                    text position.
  5293.  
  5294.                     Col            Same column as previous command.  If
  5295.                                    previous command as Group, column is
  5296.                                    incremented to be inside of the group
  5297.                                    box.  If used in brackets in text,
  5298.                                    defaults to current text position.
  5299.  
  5300.           Highlight Strings are never highlighted.  If they contain an Alt
  5301.                     key selection, and that key is pressed, the next
  5302.                     following entry item is highlighted. 
  5303.  
  5304.           See Also  Prompt.
  5305.  
  5306.           Notes     Strings are used to place plain text at certain row and
  5307.                     column positions on data entry screens.  Strings are
  5308.                     never highlighted.
  5309.  
  5310.  
  5311.  
  5312.  
  5313.  
  5314.  
  5315.  
  5316.  
  5317.  
  5318.  
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.  
  5330.  
  5331.           The JORF Manual (Shareware Disk Version)                       80
  5332.  
  5333.  
  5334.  
  5335.  
  5336.  
  5337.  
  5338.  
  5339.  
  5340.                                          Text
  5341.  
  5342.  
  5343.  
  5344.           Command   Text:""
  5345.  
  5346.           Purpose   A text input area. 
  5347.  
  5348.           Options   Row:10         Set Row
  5349.  
  5350.                     Col:10         Set Column
  5351.  
  5352.                     Wid:60         Set Width of Data Entry
  5353.  
  5354.                     Len:6          Set Length of Data Entry
  5355.  
  5356.                     After:"Expr"   Expression is executed after input.. 
  5357.  
  5358.                     Before:"Expr"  Expression is executed. If false input
  5359.                                    is skipped. 
  5360.  
  5361.                     Field:"Value"  Field Value to be entered. 
  5362.  
  5363.           Defaults  Row            One row below previous command.  
  5364.  
  5365.                     Col            Same column as previous command.  If
  5366.                                    previous command as Group, column is
  5367.                                    incremented to be inside of the group
  5368.                                    box.
  5369.  
  5370.                     Wid            If previous command was a group box,
  5371.                                    width is set to the inside width of the
  5372.                                    group box.
  5373.  
  5374.                     Len            If previous command was a group box,
  5375.                                    length is set to the inside length of
  5376.                                    the group box.
  5377.  
  5378.           Highlight Text fields are not highlighted like input fields. 
  5379.                     They remain the normal background color, even during
  5380.                     data entry.  The cursor is displayed when a text box is
  5381.                     being edited.  It is not common to prompt Text input
  5382.                     fields. 
  5383.  
  5384.           See Also  Input.
  5385.  
  5386.           Notes     Text fields are similar to input fields, except for the
  5387.                     highlighting.  Word processing is usually easier using
  5388.                     the normal screen color, instead of the field highlight
  5389.                     color.  Text input uses the screen color.
  5390.  
  5391.  
  5392.           Chapter Four - The Window Manager                              81
  5393.  
  5394.  
  5395.  
  5396.  
  5397.  
  5398.  
  5399.  
  5400.  
  5401.           Example   This is the TextEdit.J sample program, that gives you a
  5402.                     basic text editor in less than 200 lines of source
  5403.                     code.
  5404.  
  5405.           TextEdit:Start(Name)
  5406.             Mem:Ptr->Name = To:Ucs(Name)
  5407.             Mem:Ptr->Edit = TextEdit:Read(Mem:Ptr->Name)
  5408.  
  5409.             Event:Add(Null)                       | Block prior events
  5410.             Event:Add("EditKey")                  | Use standard Edit Keys
  5411.             Event:Add("TextEdit")                 |  and some special ones defined here
  5412.  
  5413.             Jorf:File("TextEdit.Tmp",Here)        | Temporary Storage area
  5414.  
  5415.             If (Name == Null)
  5416.               Kbd:Put("F4_Key")
  5417.  
  5418.             Win:Add("Josephine's Text Editor", 0, 0, 0, 0, Here)
  5419.               Save:"TextEdit:Save"
  5420.               Restore:"Null"
  5421.               Idle:"EditKey:Message"      | When idle - display Row Col info
  5422.               Flrco:"o"                   | No wrap mode
  5423.               Menu:"&File"
  5424.                 Menu:"&New      Shift-F4",    Action:'TextEdit:New'    HotKey:"Shift_F4_Key"
  5425.                 Menu:"&Open           F4",    Action:'TextEdit:Open'   HotKey:"F4_Key"
  5426.                 Menu:"&Save     Shift-F3",    Action:'TextEdit:Save'   HotKey:"Shift_F3_Key"
  5427.                 Menu:"Save &As        F3",    Action:'TextEdit:SaveAs' HotKey:"F3_Key"
  5428.                 Menu:""
  5429.                 Menu:"&Print          F5",    Action:'TextEdit:Print'  HotKey:"F5_Key"
  5430.                 Menu:""
  5431.                 Menu:"A&bout"                 Action:'TextEdit:About'
  5432.                 Menu:"E&xit        Alt-X",    Action:'TextEdit:Exit'   HotKey:"Alt_X_Key"
  5433.               Menu:"&Edit"
  5434.                 Menu:"&Toggle Insert Mode   Ins", Action:'TextEdit:Stuff("Ins_Key")'
  5435.                 Menu:"&Beginning of line   Home", Action:'TextEdit:Stuff("Home_Key")'
  5436.                 Menu:"&End of line          End", Action:'TextEdit:Stuff("End_Key")'
  5437.                 Menu:"Word &Left         Ctrl-A", Action:'TextEdit:Stuff("Ctrl_A_Key")'
  5438.                 Menu:"Word &Right        Ctrl-F", Action:'TextEdit:Stuff("Ctrl_F_Key")'
  5439.                 Menu:"&Delete Word       Ctrl-T", Action:'TextEdit:Stuff("Ctrl_T_Key")'
  5440.                 Menu:"De&lete to End   Ctrl-K Y", Action:'TextEdit:Stuff("Ctrl_K_Key",
  5441.           "Y_Key")'
  5442.               Menu:"&Block"
  5443.                 Menu:"&Beginning  Ctrl-K B",  Action:'TextEdit:Stuff("Ctrl_K_Key","B_Key")'
  5444.                 Menu:"&End        Ctrl-K K",  Action:'TextEdit:Stuff("Ctrl_K_Key","K_Key")'
  5445.                 Menu:"&Delete     Ctrl-K Y",  Action:'TextEdit:Stuff("Ctrl_K_Key","Y_Key")'
  5446.                 Menu:"&Copy       Ctrl-K C",  Action:'TextEdit:Stuff("Ctrl_K_Key","C_Key")'
  5447.                 Menu:"&Move       Ctrl-K V",  Action:'TextEdit:Stuff("Ctrl_K_Key","V_Key")'
  5448.                 Menu:"&Hide       Ctrl-K H",  Action:'TextEdit:Stuff("Ctrl_K_Key","H_Key")'
  5449.               Menu:"&Goto"
  5450.                 Menu:"&Beginning of file  Ctrl-Q R", 
  5451.           Action:'TextEdit:Stuff("Ctrl_Q_Key","R_Key")'
  5452.  
  5453.           The JORF Manual (Shareware Disk Version)                       82
  5454.  
  5455.  
  5456.  
  5457.  
  5458.  
  5459.  
  5460.  
  5461.                 Menu:"&End of file        Ctrl-Q C", 
  5462.           Action:'TextEdit:Stuff("Ctrl_Q_Key","C_Key")'
  5463.                 Menu:"&Line Number        Ctrl-Q G", 
  5464.           Action:'TextEdit:Stuff("Ctrl_Q_Key","G_Key")'
  5465.               Menu:"&Search"
  5466.                 Menu:"&Find        Ctrl-Q F", Action:'TextEdit:Stuff("Ctrl_Q_Key","F_Key")'
  5467.                 Menu:"Find &Next     Ctrl-L", Action:'TextEdit:Stuff("Ctrl_L_Key")'
  5468.                 Menu:"&Replace     Ctrl-Q A", Action:'TextEdit:Stuff("Ctrl_Q_Key","A_Key")'
  5469.               Text:'', Field:'Mem:Ptr->Edit' Row:1 Col:1 Wid:78 Len:22
  5470.  
  5471.             File:Del("TextEdit.Tmp")              | Delete Storage area
  5472.             Return
  5473.  
  5474.           TextEdit:About
  5475.             Msg:Add ("About TextEdit", "Ok")
  5476.               Version 1.1                              May 11, 1992
  5477.                   Copyright (C) 1991,1992 by The JORF Company
  5478.             Return (Ok)
  5479.  
  5480.           TextEdit:New()
  5481.             If (TextEdit:Save)
  5482.               EditKey:Ctrl_Page_Up_Key
  5483.               Mem:Ptr->Name = Null
  5484.               Mem:Ptr->Edit = Text:Add()
  5485.               Win:Dsp
  5486.             Return (Ok)
  5487.  
  5488.           TextEdit:Open
  5489.             New (Name)
  5490.             Name = DirList:GetFile("*.txt")
  5491.             If (Name)
  5492.               If (TextEdit:Save)
  5493.                 Mem:Ptr->Name = To:Ucs(Name)
  5494.                 Mem:Ptr->Edit = TextEdit:Read (Name)
  5495.                 Win:Dsp
  5496.             Return (Ok)
  5497.  
  5498.           TextEdit:Print()
  5499.             New (Dest)
  5500.             Dest=Jorf:Printer()
  5501.             File:Save("JREPORT.LST",Mem:Ptr->Edit)
  5502.             File:Print("JREPORT.LST",Dest)
  5503.             Return(Ok)
  5504.  
  5505.           TextEdit:Read(FileName)
  5506.             If (FileName)
  5507.               If (File:Exist (FileName))
  5508.                 Win:Add ('Reading')
  5509.                   Loading file "{FileName}"
  5510.                 Return (File:Load (FileName))
  5511.               Else
  5512.                 Msg:Add ('Error', 'Ok')
  5513.  
  5514.           Chapter Four - The Window Manager                              83
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.                   Cannot find file "{FileName}"
  5523.             Return (Text:Add)
  5524.  
  5525.           TextEdit:Save
  5526.             If (Mem:Ptr->Name==Null)
  5527.               TextEdit:SaveAs()
  5528.             Else
  5529.               TextEdit:Write (Mem:Ptr->Name, Mem:Ptr->Edit)
  5530.               Jorf:Del (Win:Ptr->Copy)
  5531.               Win:Ptr->Copied=False
  5532.             Return (Ok)
  5533.  
  5534.           TextEdit:SaveAs
  5535.             New (Key, FileName)
  5536.             FileName = Mem:Ptr->Name
  5537.             While (Ok)
  5538.               Win:Add ('File Name')
  5539.                 Input:'File Name to Save ', Wid:30, Field:'FileName'
  5540.               Win:Del
  5541.               If (Kbd:Got == 'Esc_Key')
  5542.                 Return (Ok)
  5543.               If (FileName != Null)
  5544.                 If (File:Exist (FileName) != 0)
  5545.                   Key=Msg:Add ('File Already Exists' 'No')
  5546.                     File "{FileName}" Already Exists!
  5547.                     Do you want to overwrite it?
  5548.                   If (Key==Null)          | If not ok - loop back to while OK
  5549.                     Continue
  5550.               Break                       | Otherwise break and write file
  5551.             Mem:Ptr->Name = To:Ucs(FileName)
  5552.             TextEdit:Write (Mem:Ptr->Name, Mem:Ptr->Edit)
  5553.             Jorf:Del (Win:Ptr->Copy)
  5554.             Win:Ptr->Copied=False
  5555.             Return (Ok)
  5556.  
  5557.           TextEdit:Stuff (Key1,Key2)
  5558.             Kbd:Put(Key1)
  5559.             Kbd:Put(Key2)
  5560.             Return(Null)
  5561.  
  5562.           TextEdit:Write (FileName, Text)
  5563.             If (FileName And Text)
  5564.               Win:Add ('Writing')
  5565.                 Saving file "{FileName}"
  5566.               File:Save (FileName, Text)
  5567.             Return (Ok)
  5568.  
  5569.  
  5570.  
  5571.  
  5572.  
  5573.  
  5574.  
  5575.           The JORF Manual (Shareware Disk Version)                       84
  5576.  
  5577.  
  5578.  
  5579.  
  5580.  
  5581.  
  5582.  
  5583.  
  5584.  
  5585.  
  5586.  
  5587.  
  5588.  
  5589.  
  5590.  
  5591.                                      Chapter Five
  5592.                                     JORF Functions
  5593.  
  5594.  
  5595.            
  5596.  
  5597.                                     JORF Functions
  5598.  
  5599.           In JORF, as in all object oriented languages, a Method for one
  5600.           object often invokes a method for another object.  This process
  5601.           continues until finally, a low level object invokes a library
  5602.           routine.  For example the command Print (integer:A) invokes the
  5603.           Integer:Print(A) Method that may then invoke the Number:Print(A)
  5604.           Method that invokes the Jorf:Print(A) Method. At some point,
  5605.           control is passed to the underlying system that prints the data.
  5606.  
  5607.           The JORF Function library is implemented in the C language.  This
  5608.           library is not object oriented nor is it interpreted so there is
  5609.           no ability for polymorphism or inheritance on this level.  JORF
  5610.           Library calls are made without any regard to class or
  5611.           inheritance.  All parameters passed into C language calls are
  5612.           treated as generic JORF pointers, and return values take on the
  5613.           class of the first parameter that was passed in.
  5614.  
  5615.  
  5616.  
  5617.  
  5618.  
  5619.  
  5620.  
  5621.  
  5622.  
  5623.  
  5624.  
  5625.  
  5626.  
  5627.  
  5628.  
  5629.  
  5630.  
  5631.  
  5632.  
  5633.  
  5634.  
  5635.  
  5636.           Chapter Four - The Window Manager                              85
  5637.  
  5638.  
  5639.  
  5640.  
  5641.  
  5642.  
  5643.  
  5644.  
  5645.                                        Arr:Del
  5646.  
  5647.  
  5648.  
  5649.           Function  Arr:Del ( Array, Position, Count ) 
  5650.  
  5651.           Purpose   Delete Count elements from Array, starting with the
  5652.                     indicated Position. 
  5653.  
  5654.           Returns   Array.
  5655.  
  5656.           See Also  Arr:Ins
  5657.  
  5658.           Notes     Array handling is usually done by referencing
  5659.                     individual array items.  Arrays do not need to be
  5660.                     declared, and are created simply by setting values to
  5661.                     their elements.  Arr functions are used to change the
  5662.                     whole array, without reference to the elements. 
  5663.  
  5664.                     The Arr:Del command may be used to delete one or more
  5665.                     elements in the middle of an array.  It automatically
  5666.                     decrements succeeding elements so the array shrinks in
  5667.                     size by the number of elements deleted. 
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.  
  5684.  
  5685.  
  5686.  
  5687.  
  5688.  
  5689.  
  5690.  
  5691.  
  5692.  
  5693.  
  5694.  
  5695.  
  5696.  
  5697.           The JORF Manual (Shareware Disk Version)                       86
  5698.  
  5699.  
  5700.  
  5701.  
  5702.  
  5703.  
  5704.  
  5705.  
  5706.                                        Arr:Dir
  5707.  
  5708.  
  5709.  
  5710.           Function  Arr:Dir ( WildCard, Ext_Exclusion_List ) 
  5711.  
  5712.           Purpose   Return an Array of files on the current directory that
  5713.                     match the designated WildCard but are not in the
  5714.                     Extension Exclusion List. 
  5715.  
  5716.           Returns   Array.
  5717.  
  5718.           See Also  Arr:Sort, Arr:Pick, File:ChgDir.
  5719.  
  5720.           Notes     The easiest way to get and display a list of files on
  5721.                     the current directory.  Arr:Dir with no parameters will
  5722.                     get a list of all files on the current directory. 
  5723.  
  5724.                     Files may be read according to the designated wildcard. 
  5725.                     This may be any valid DOS wildcard symbol, just as you
  5726.                     would use from DOS.  The following command makes a list
  5727.                     of all the text files on a directory:
  5728.  
  5729.                                    Arr:Dir("*.TXT")
  5730.  
  5731.                     Files with certain extensions can be excluded by
  5732.                     including them in the extension exclusion list.  This
  5733.                     list is a string with a list of extensions separated by
  5734.                     commas.  Two commas together indicate files without
  5735.                     extensions.  The following command will collect a list
  5736.                     of all files except those with .BAK, .OBJ, .INI or no
  5737.                     extension. 
  5738.  
  5739.                                    Arr:Dir("*.*", "BAK,OBJ,INI,,")    
  5740.  
  5741.                     The Arr:Del command may be used to delete one or more
  5742.                     elements in the middle of an array.  It automatically
  5743.                     decrements succeeding elements so the array shrinks in
  5744.                     size by the number of elements deleted. 
  5745.  
  5746.                     If the WildCard has the value "Subdir", then the file
  5747.                     list will be a list of subdirectories.  Otherwise, it
  5748.                     will only contain files.  
  5749.  
  5750.           Example   The DIRLIST.J program is also compiled into the runtime
  5751.                     system and documented as DirList:GetFile.
  5752.  
  5753.           Class:DirList                   | Class Definition
  5754.             Name                          | File Name
  5755.             Path                          | File Path
  5756.             WildCard                      | Wildcard for directory
  5757.  
  5758.           Chapter Five - JORF Functions                                  87
  5759.  
  5760.  
  5761.  
  5762.  
  5763.  
  5764.  
  5765.  
  5766.             ExclusionList                 | Extension Exclusion List
  5767.             FileArray                     | Array of files on this path
  5768.             DirArray                      | Array of other paths
  5769.  
  5770.           DirList:Start                   | FOR TESTING:  Start routine
  5771.             New (FileName)
  5772.             FileName = DirList:GetFile("*.*",Null)
  5773.             Msg:Add
  5774.               File name is {FileName}
  5775.             Return (Ok)
  5776.  
  5777.           DirList:Cancel(List)            | Routine to Cancel data entry
  5778.             List->Name=Null               | Signal that we canceled
  5779.             Return(Null)                  | Returning Null will finish input
  5780.  
  5781.           DirList:Done(List,Name)         | Routine to finish data entry
  5782.             If (Str:In(List->Name,"*") Or Str:In(List->Name,"?"))
  5783.               List->WildCard  = List->Name
  5784.               List->FileArray = DirList:FileArray(List->Wildcard, List->Exclusionlist)
  5785.               Kbd:Put("Home_Key")       | Stuff home key
  5786.               Win:Dsp                   | Redisplay (including arrays)
  5787.               Return (Ok)
  5788.             If (List->Name==Null)         | If name is still null display message
  5789.               Msg:Add
  5790.                 Please select a file
  5791.                 name or "Cancel".
  5792.               Return (Ok)                 | Returning Ok will continue input
  5793.             Return (Null)                 | Returning Null will finish input
  5794.  
  5795.           DirList:FileArray(WildCard,Exclusionlist)  | Read a file array
  5796.             New (Array,OldMessage)
  5797.             If (WildCard!='SUBDIR')
  5798.               If (Win:Ptr)
  5799.                 OldMessage = Win:Msg('Reading Directory')
  5800.               Else
  5801.                 Win:Add("Reading")
  5802.              Reading Directory
  5803.             Array = Arr:Dir (WildCard, ExclusionList, 12)
  5804.             If (WildCard!='SUBDIR')
  5805.               Win:Msg(OldMessage)
  5806.             Return (Array)
  5807.  
  5808.           DirList:GetFile(WildCard,ExclusionList)
  5809.             New (OrigPath, DirList:List, DirChoice, FileChoice)
  5810.  
  5811.             | Initalize values
  5812.             OrigPath            = File:ChDir()
  5813.             List->Path          = OrigPath
  5814.             List->WildCard      = WildCard
  5815.             List->ExclusionList = Exclusionlist
  5816.             List->FileArray     = DirList:FileArray(List->Wildcard, List->Exclusionlist)
  5817.             List->DirArray      = DirList:FileArray("SUBDIR")
  5818.  
  5819.           The JORF Manual (Shareware Disk Version)                       88
  5820.  
  5821.  
  5822.  
  5823.  
  5824.  
  5825.  
  5826.  
  5827.             Event:Add(Null)               | Block prior keystroke events
  5828.             Win:Add ("Get File Name", 0, 0, 10, 56, Here)
  5829.               Type:"Message"
  5830.  
  5831.               | Input File Name
  5832.               Input:"File&name:  ",  Wid:24, Row:2, Col:3, Field:"List->Name"
  5833.  
  5834.               | Files array with a group box around
  5835.               Group:"&Files",       Row:6, Col:2, Wid:16, Len:10
  5836.               Array:"", Field:"List->FileArray",
  5837.                         Choice:"FileChoice",
  5838.                         Action:"DirList:NewName(List,List->FileArray[FileChoice])"
  5839.  
  5840.               | Directories array with a group box around
  5841.               Group:"&Directories", Row:6, Col:22, Wid:16, Len:10
  5842.               Array:"", Field:"List->DirArray",
  5843.                         Choice:"DirChoice"
  5844.                         Action:"DirList:NewDir(List,List->DirArray[DirChoice])"
  5845.               | Input File Path
  5846.               Input:"Directory: ",   Wid:24, Row:4, Col:3, Field:"List->Path"
  5847.                    After:"DirList:NewDir(List,List->Path)"
  5848.               | Two buttons
  5849.               Button:"   &Ok   ", Row:1, Col:42, Wid:14
  5850.                 Action:"DirList:Done(List,List->FileArray[FileChoice])"
  5851.               Button:" &Cancel ", Row:4, Col:42, Wid:14
  5852.                 Action:"DirList:Cancel(List)"
  5853.  
  5854.             If (File:ChDir(OrigPath))
  5855.               If (List->Name)
  5856.                 If (Str:At(List->Path,Str:Len(List->Path),1)=='\')
  5857.              Return (List->Path+List->Name)
  5858.                 Return (List->Path+'\'+List->Name)
  5859.             Return (Null)
  5860.  
  5861.           DirList:NewDir(List,Path)       | Routine to set a new path
  5862.             If (File:Chdir(Path))         | Change to the new path
  5863.               List->Path = File:ChDir()   | Reset path name
  5864.               List->Name = Null           | Set file name to null
  5865.               | Re-read file array
  5866.               List->FileArray = DirList:FileArray(List->Wildcard, List->Exclusionlist)
  5867.               | Re-Read directory array - special argument "SUBDIR" does this
  5868.               List->DirArray  = DirList:FileArray("SUBDIR")
  5869.               Win:Dsp                     | Redisplay Window
  5870.             Return(Ok)                    | Returning Ok continues input
  5871.  
  5872.           DirList:NewName(List,Name)      | Routine to set a new name
  5873.             List->Name = Word:At(Name,1)  | Set the name (Easy!)
  5874.             Win:Dsp                       | Redisplay the screen
  5875.             Kbd:Put("Home_Key")         | And go back to file name
  5876.             Return(Ok)                    | Returning OK will continue input
  5877.  
  5878.  
  5879.  
  5880.           Chapter Five - JORF Functions                                  89
  5881.  
  5882.  
  5883.  
  5884.  
  5885.  
  5886.  
  5887.  
  5888.  
  5889.                                        Arr:Ins
  5890.  
  5891.  
  5892.  
  5893.           Function  Arr:Ins ( Array, Position, Count ) 
  5894.  
  5895.           Purpose   Insert Count elements into Array, starting with the
  5896.                     indicated Position. 
  5897.           Returns   Array.
  5898.  
  5899.           See Also  Arr:Del
  5900.  
  5901.           Notes     Array handling is usually done by referencing
  5902.                     individual array items.  Arrays do not need to be
  5903.                     declared, and are created simply by setting values to
  5904.                     their elements.  Arr functions are used to change the
  5905.                     whole array, without reference to the elements. 
  5906.  
  5907.                     The Arr:Ins command may be used to insert one or more
  5908.                     elements in the middle of an array.  It automatically
  5909.                     increments succeeding elements so the array grows in
  5910.                     size by the number of elements inserted. 
  5911.  
  5912.  
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.  
  5925.  
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.           The JORF Manual (Shareware Disk Version)                       90
  5942.  
  5943.  
  5944.  
  5945.  
  5946.  
  5947.  
  5948.  
  5949.  
  5950.                                        Arr:Len
  5951.  
  5952.  
  5953.  
  5954.           Function  Arr:Len ( Array ) 
  5955.  
  5956.           Purpose   Returns the highest offset in the array. 
  5957.  
  5958.           Returns   Integer Offset.
  5959.  
  5960.           See Also  Word:Len
  5961.  
  5962.           Notes     Returns the length of an array.  Actually, returns the
  5963.                     offset of the highest element of the array, which is
  5964.                     also the length if the first element is element number
  5965.                     1. 
  5966.  
  5967.                     Arrays may contain element 0, and also negative
  5968.                     elements.  If this is the case, the actual length may
  5969.                     be longer than the value of this command. 
  5970.  
  5971.           Example   This program is pretty old, written before there were
  5972.                     buttons and a nice window manager.  For that reason, it
  5973.                     shows pretty well the Arr:Len and Arr:Pick commands
  5974.                     that are hidden when you use DirList:GetFile.
  5975.  
  5976.           Dump:Start
  5977.             New (WildCard, FileList, Choice)
  5978.             New (FileName, Char, Length, Pos, Col)
  5979.  
  5980.             While (Ok)
  5981.               | First get a wildcard for dir command
  5982.               Win:Add ("Dump a File")
  5983.                 Input:"Directory WildCard: ", Field:"WildCard"
  5984.               If (Kbd:Got = 'Esc_Key')
  5985.                 Return
  5986.  
  5987.               | Read the directory
  5988.               Win:Add("Reading Directory")
  5989.                 One Moment Please . . .
  5990.               FileList  = Arr:Dir(WildCard)
  5991.               If Arr:Len(FileList) < 1
  5992.                 Msg:Add
  5993.                   No Files match the WildCard!
  5994.               Else
  5995.                 While FileList != Null
  5996.                   | And ask to pick a file
  5997.                   Choice   = Arr:Pick(FileList,Null,"Dump File", 0, 0, 0, Choice)
  5998.              If Kbd:Got = 'Esc_Key'
  5999.                     Break
  6000.  
  6001.  
  6002.           Chapter Five - JORF Functions                                  91
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.                   | Got a file name!
  6011.                   FileName = FileList[Choice]
  6012.                   FileName = Str:At (FileName 1, Str:In(FileName," "))
  6013.                   Length   = File:Len (FileName)
  6014.                   Pos      = 0
  6015.  
  6016.                   Win:Add (FileName, 2, 8, (Length/16)+2, 78, Here)
  6017.  
  6018.                   While (Pos < Length)
  6019.                     Col = (Pos % 16)     | Set column position
  6020.                     If (Col == 0)        | If beginning new line
  6021.                       If (Pos > 0)       | If after first line
  6022.                         Move:By (1,0)    | Start a new line
  6023.                         Move:To (0,1)    |
  6024.                       Str:Put (To:Str(Pos,"0000:0000",16))
  6025.                     ++Pos
  6026.                     | Read One Character
  6027.                Char = File:Read (FileName,1,Pos)
  6028.                     | And Display It . . .
  6029.                     Move:To (0,13+(Col*3))
  6030.                     Str:Put (To:Str(To:Ascii(Char),'00',16))
  6031.                     Move:To (0,62+Col)
  6032.                     Char:Put (To:Ascii(Char))
  6033.                If Kbd:Hit           | If key hit
  6034.                  Char = Kbd:Get     | See What it is
  6035.                       If Char = "Esc_Key"| If Escape
  6036.                         Break            |      Break
  6037.                       Win:Pause          |   Pause
  6038.                   Str:PutLine            | One more line
  6039.                   Str:PutLine            | One more line
  6040.                   Win:Msg("End of File") | Done!
  6041.                   Win:Pause              | Wait
  6042.                   Win:Del                | Delete window
  6043.                 Win:Del
  6044.               Win:Del
  6045.               Win:Del
  6046.             Return                       | Exit
  6047.  
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.           The JORF Manual (Shareware Disk Version)                       92
  6064.  
  6065.  
  6066.  
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072.                                        Arr:Pick
  6073.  
  6074.  
  6075.           Function  Arr:Pick (Array, Command, Title, Row, Column, Length,
  6076.                     Default)
  6077.  
  6078.           Purpose   Display a browser menu of array items with Title, at
  6079.                     Row and Column, no longer than Length and highlighting
  6080.                     Default.
  6081.  
  6082.           Returns   Integer offset of selection or "Esc_Key".
  6083.  
  6084.           See Also  Arr:Sort
  6085.  
  6086.           Notes     One of the more powerful JORF command, this is what
  6087.                     displays the file list when you start the JORF
  6088.                     interpreter, and also what displays the debugger Alt-B
  6089.                     browser lists. 
  6090.  
  6091.                     This command returns Null, if Array is blank or not an
  6092.                     array.  All other parameters may be omitted.
  6093.  
  6094.                     The Length is only the maximum to display.  If the
  6095.                     array is shorter, then the menu length will be the
  6096.                     length of the array.  If the array is longer, then it
  6097.                     will scroll automatically. 
  6098.  
  6099.                     The Array pick does not set or block keystroke events,
  6100.                     and existing events often interfere with array
  6101.                     selection.  To prevent this, it is typical to include
  6102.                     do Event:Add with no parameters before calling
  6103.                     Arr:Pick.  Adding a null keystroke event blocks
  6104.                     processing from searching down the stack to process
  6105.                     lower level keystroke events.
  6106.  
  6107.                     Menu options are displayed as strings.  Both Arr:Pick
  6108.                     and Arr:Sort make use of a polymorphic Command to get
  6109.                     the value of these strings.  If command is Null, the
  6110.                     normal string value is used. For structures, you can
  6111.                     set up a method that returns a string that represents
  6112.                     that structure.  for instance, the Address structure
  6113.                     may show Name, City and State:
  6114.  
  6115.                     Class:Address, Name, Addr1, Addr2, City, State, Zip
  6116.  
  6117.                     Address:Show(Addr)
  6118.                       Return (Str:Pad (Addr->Name, 30)+" "+Addr->City+", "+Addr->Zip)
  6119.  
  6120.           Example   See Arr:Len and the Dump.J sample program.
  6121.  
  6122.  
  6123.  
  6124.           Chapter Five - JORF Functions                                  93
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.                                      Arr:Printers
  6134.  
  6135.  
  6136.           Function  Arr:Printers
  6137.  
  6138.           Purpose   Return an Array of available printers. 
  6139.  
  6140.           Returns   Array.
  6141.  
  6142.           See Also  Arr:Pick, Jorf:Printer and JORF.INI documentation in
  6143.                     Appendix D.
  6144.  
  6145.           Notes     This command reads the printers listed in your JORF.INI
  6146.                     or JORFWIN.INI file and creates an array.  You can use
  6147.                     this array on a data entry screen or with the Arr:Pick
  6148.                     function.  
  6149.  
  6150.                     Each entry can be assumed to be a string that contains
  6151.                     a description, and a printer designation.   The printer
  6152.                     is assumed to be the last word of the command.
  6153.  
  6154.           Example   This is not a sample program, but the actual code that
  6155.                     is converted to C and run when you use the Jorf:Printer
  6156.                     function.  If you wish, you can type it in quickly to
  6157.                     play with it to make your own printer selection menu.
  6158.  
  6159.            
  6160.                     Jorf:Printer
  6161.                       New (PrintList,PrintChoice,Dest)
  6162.  
  6163.                       Event:Add()
  6164.                       PrintList = Arr:Printers()
  6165.                       Win:Add("Select Printer")
  6166.                         Group:"&Printers", Row:1 Col:1 Len:6 Wid:22
  6167.                         Array:"" Field:"PrintList" Choice:"PrintChoice"
  6168.  
  6169.                         Button:"   &Go   " Row:1 Col:32
  6170.                           Action:"Dest=PrintList[PrintChoice]"
  6171.                         Button:" &Cancel " Row:4 Col:32 Action:"Return ('Esc_Key')"
  6172.                       If (Dest='Esc_Key' Or Kbd:Got='Esc_Key')
  6173.                         Dest=Null
  6174.                       Return(Dest)
  6175.  
  6176.  
  6177.  
  6178.  
  6179.  
  6180.  
  6181.  
  6182.  
  6183.  
  6184.  
  6185.           The JORF Manual (Shareware Disk Version)                       94
  6186.  
  6187.  
  6188.  
  6189.  
  6190.  
  6191.  
  6192.  
  6193.  
  6194.                                        Arr:Sort
  6195.  
  6196.  
  6197.  
  6198.           Function  Arr:Sort ( Array, Command, Direction ) 
  6199.  
  6200.           Purpose   Sort the elements of an array. 
  6201.  
  6202.           Returns   Array. 
  6203.  
  6204.           Notes     The only sort command in the JORF language.  Normally
  6205.                     sorts elements in ascending order.  You can sort
  6206.                     descending by specifying a Direction of "Down" or
  6207.                     "Descending" (or anything that begins with the letter
  6208.                     'D'). 
  6209.  
  6210.                     Arr:Sort makes use of a polymorphic Command to get the
  6211.                     string value of the array element.  If this is Null
  6212.                     then the string value is used.  If not null, the
  6213.                     Command should be a method that takes exactly one
  6214.                     parameter.  The parameter will be filled with the value
  6215.                     being sorted.   The method must return a string value
  6216.                     that represents the sort index value.
  6217.  
  6218.                     Class:Address, Name, Addr1, Addr2, City, State, Zip
  6219.  
  6220.                     Address:SortString(Addr)
  6221.                          Return (Addr->Name)
  6222.  
  6223.  
  6224.  
  6225.  
  6226.  
  6227.  
  6228.  
  6229.  
  6230.  
  6231.  
  6232.  
  6233.  
  6234.  
  6235.  
  6236.  
  6237.  
  6238.  
  6239.  
  6240.  
  6241.  
  6242.  
  6243.  
  6244.  
  6245.  
  6246.           Chapter Five - JORF Functions                                  95
  6247.  
  6248.  
  6249.  
  6250.  
  6251.  
  6252.  
  6253.  
  6254.  
  6255.           Example   For normal use, see Arr:Len and the Dump.J sample
  6256.                     program.   For use of Arr:Sort with a Command, the
  6257.                     Help.J program uses this combination to sort an array
  6258.                     of structure pointers.   Here are a coupe methods from
  6259.                     that program.
  6260.  
  6261.           Class:Help (Index:Help, Array, A1, A2, A3)
  6262.  
  6263.           Class:HelpArr (Name Array)
  6264.  
  6265.           Help:CatName(Harr)
  6266.             Return (Harr->Name)
  6267.  
  6268.           Help:Load()
  6269.             New (Rule:Rule, Help:HelpPtr, Name, Pos)
  6270.  
  6271.             HelpPtr->Help = "Help"
  6272.             Jorf:Write (HelpPtr)
  6273.  
  6274.             Rule->Obj="Help"
  6275.             Rule->Prob=100
  6276.             Rule->Type=121
  6277.             Rule->KLen=1
  6278.             Win:Add ("Loading Help Information")
  6279.             While (Ok)
  6280.               Rule:Next (Rule)
  6281.               If (Rule->Fnd)
  6282.                 Name = Word:At(Rule->Ptr,1)
  6283.                 Str:Put (Name)
  6284.                 Str:Put (" - ")
  6285.                 Switch
  6286.                   Case Str:In (Name, ":")
  6287.                     Help:PutEntry(HelpPtr,Null,Name)
  6288.                   Case Str:Len (Name) <= 2 Or Str:In(Name,"or")
  6289.                     Help:PutEntry(HelpPtr,"[Math]",Name)
  6290.                   Case Str:Len (Name), < 4
  6291.                   Case Str:In  (Name, "/")
  6292.                   Case Str:In  ("True False Return Else Null Here", (Name) )
  6293.                     Help:PutEntry(HelpPtr,"[Control]",Name)
  6294.                   Case (Str:Len (Name) > 0)
  6295.                     Help:PutEntry(HelpPtr,"[Win]",Name)
  6296.               Else
  6297.                 Break
  6298.             Arr:Sort(HelpPtr->Array,"Help:CatName")
  6299.             Jorf:Write(HelpPtr)
  6300.             Return (HelpPtr)
  6301.  
  6302.  
  6303.  
  6304.  
  6305.  
  6306.  
  6307.           The JORF Manual (Shareware Disk Version)                       96
  6308.  
  6309.  
  6310.  
  6311.  
  6312.  
  6313.  
  6314.  
  6315.  
  6316.                                        Char:Del
  6317.  
  6318.  
  6319.           Function  Char:Del ( Count ) 
  6320.  
  6321.           Purpose   Delete Count characters in the current window at the
  6322.                     current cursor position.
  6323.  
  6324.           Returns   None.
  6325.  
  6326.           See Also  Char:Ins
  6327.  
  6328.           Notes     This command does two specific things;  1) it deletes
  6329.                     Count characters at the current location in the current
  6330.                     window, and 2) it deletes Count characters in the line
  6331.                     currently being edited.  The line edit buffer is
  6332.                     separate from the screen, although they usually reflect
  6333.                     the same data.
  6334.  
  6335.                     The line and paragraph may rewrap if the window Magic
  6336.                     is True and the window FLRCO is not "Off".
  6337.  
  6338.           Example   The Charex.J sample program shows one way to use the
  6339.                     Char:Ins and Char:Del functions.  Because these
  6340.                     functions operate only on the screen, they are most
  6341.                     appropriate to methods that change text that is being
  6342.                     edited on the screen.
  6343.  
  6344.                     CharEx:Start 
  6345.                       New Count, Str1, Str2 
  6346.                       Str1="This Text will Disappear" 
  6347.                       Str2="This Text will Appear" 
  6348.                       Win:Add ("Char Example", 10, 25, 30, 2, Here)
  6349.                       Str:Put (Str1)          | Show Str1 
  6350.                       Win:Pause (20)          | And pause for Effect 
  6351.                       Count = Str:Len (Str1)  | Set Counter 
  6352.                       While (Count > 0)       | While GT Zero 
  6353.                         Move:To (1,1)         |   First line 
  6354.                         Char:Del (1)          |   Take 1 Away 
  6355.                         Move:To (2,1)         |   Second line 
  6356.                         Char:Ins (1)          |   Add one, Add char 
  6357.                         Char:Put (To:Ascii (Str:At (Str2, Count, 1)))
  6358.                         --Count               |   Decrement Count 
  6359.                         Win:Pause(5)          |   Pause 5/100 seconds 
  6360.                       Win:Pause               | Done! 
  6361.                       Return                  | Bye 
  6362.  
  6363.  
  6364.  
  6365.  
  6366.  
  6367.  
  6368.           Chapter Five - JORF Functions                                  97
  6369.  
  6370.  
  6371.  
  6372.  
  6373.  
  6374.  
  6375.  
  6376.  
  6377.                                        Char:Get
  6378.  
  6379.  
  6380.           Function  Char:Get
  6381.  
  6382.           Purpose   Gets a character displayed on the current window.  
  6383.  
  6384.           Returns   ASCII decimal value of the character.
  6385.  
  6386.           See Also  Char:Put.
  6387.  
  6388.           Notes     To get a keystroke value, use Kbd:Get.  This function
  6389.                     reads the value off the screen, assuming that you put
  6390.                     something there worth reading.  The value returned is
  6391.                     numeric, because the most common use of this function
  6392.                     is to handle OEM characters.  This command is
  6393.                     symmetrical to Char:Put.
  6394.  
  6395.  
  6396.  
  6397.  
  6398.  
  6399.  
  6400.  
  6401.  
  6402.  
  6403.  
  6404.  
  6405.  
  6406.  
  6407.  
  6408.  
  6409.  
  6410.  
  6411.  
  6412.  
  6413.  
  6414.  
  6415.  
  6416.  
  6417.  
  6418.  
  6419.  
  6420.  
  6421.  
  6422.  
  6423.  
  6424.  
  6425.  
  6426.  
  6427.  
  6428.  
  6429.           The JORF Manual (Shareware Disk Version)                       98
  6430.  
  6431.  
  6432.  
  6433.  
  6434.  
  6435.  
  6436.  
  6437.  
  6438.                                        Char:Ins
  6439.  
  6440.  
  6441.  
  6442.           Function  Char:Ins ( Count ) 
  6443.  
  6444.           Purpose   Insert Count spaces in the current window at the
  6445.                     current cursor position.
  6446.  
  6447.           Returns   None.
  6448.  
  6449.           See Also  Char:Del
  6450.  
  6451.           Notes     This command does two specific things;  1) it inserts
  6452.                     Count spaces at the current location in the current
  6453.                     window, and 2) it inserts Count spaces in the line
  6454.                     currently being edited.  The line edit buffer is
  6455.                     separate from the screen, although they usually reflect
  6456.                     the same data.
  6457.  
  6458.                     If the line length exceeds the window boundary, and
  6459.                     window is in one of the wrap modes, the line and
  6460.                     paragraph will be reformatted.  This formatting takes
  6461.                     place only on the screen, and not in the edit buffer.
  6462.  
  6463.           Example   See Char:Del. 
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471.  
  6472.  
  6473.  
  6474.  
  6475.  
  6476.  
  6477.  
  6478.  
  6479.  
  6480.  
  6481.  
  6482.  
  6483.  
  6484.  
  6485.  
  6486.  
  6487.  
  6488.  
  6489.  
  6490.           Chapter Five - JORF Functions                                  99
  6491.  
  6492.  
  6493.  
  6494.  
  6495.  
  6496.  
  6497.  
  6498.  
  6499.                                        Char:Put
  6500.  
  6501.  
  6502.  
  6503.           Function  Char:Put ( Value ) 
  6504.  
  6505.           Purpose   Put an ASCII character on the current window at the
  6506.                     current cursor location.
  6507.  
  6508.           Returns   None.
  6509.  
  6510.           See Also  Char:Get, Str:Put.
  6511.  
  6512.           Notes     It is atypical for a JORF Language function to use
  6513.                     ASCII values for characters.  Usually, characters are
  6514.                     strings and are displayed using Str:Put.  However, some
  6515.                     graphics characters are easier to display as numbers
  6516.                     because they have no letter equivalent.  
  6517.  
  6518.                     This function is buffered for speed.  Calling this
  6519.                     function sets the internal buffer, but the buffer is
  6520.                     not shown on the screen until the line is finished. You
  6521.                     can force a display by changing to another line using
  6522.                     Move:To or by ending the line using Str:PutLine.
  6523.  
  6524.           Example
  6525.  
  6526.  
  6527.           Ascii:Start
  6528.             New Char
  6529.             Win:Add("ASCII TABLE", 4, 4, 19, 74, Here)
  6530.  
  6531.             For (Char = 0 Thru 15)
  6532.               Move:To(1,(Char*4)+10)
  6533.               Str:Put(To:Str(Char))
  6534.               Move:To(Char+3,1)
  6535.               Str:Put(To:Str(Char*16))
  6536.  
  6537.             Move:To(2,1)
  6538.             Win:Attr("Lo")
  6539.             For (Char = 0 Thru 255)
  6540.               If ((Char % 16) == 0)
  6541.                 Move:By(1,0)
  6542.                 Move:To(0,10)
  6543.               Char:Put(Char)
  6544.               Move:By(0,3)
  6545.             Win:Msg("Press Enter to Continue")
  6546.             Win:Pause
  6547.  
  6548.  
  6549.  
  6550.  
  6551.           The JORF Manual (Shareware Disk Version)                      100
  6552.  
  6553.  
  6554.  
  6555.  
  6556.  
  6557.  
  6558.  
  6559.  
  6560.                                        Class:At
  6561.  
  6562.           Function  Class:At ( Structure Position ) 
  6563.  
  6564.           Purpose   Returns class of word in parsed command line, or label
  6565.                     of a structure member. 
  6566.  
  6567.           Returns   Class.
  6568.  
  6569.           See Also  Class:AtPut, Word:At.
  6570.  
  6571.           Notes     Structures, Arrays, the JORF stack, and lines of text
  6572.                     are all stored as arrays of Class:Word pairs.  The
  6573.                     number of words in the array can be obtained using
  6574.                     Word:Len.
  6575.  
  6576.                                       Structures
  6577.  
  6578.                     Normally, you access structure elements using the
  6579.                     pointer operator (->).  However, you can also use this
  6580.                     command to referencing the elements directly.  
  6581.  
  6582.                                         Stack
  6583.  
  6584.                     Each level of the stack (each method call) creates a
  6585.                     new structure.  The first element has the class Method
  6586.                     and is the current program line.  The second element
  6587.                     has the class From and is the previous level of the
  6588.                     stack.  The next elements are the parameters in the
  6589.                     order they were passed.  Then, any New variables with
  6590.                     the variable name standing for the class name.
  6591.  
  6592.                                       New Values
  6593.  
  6594.                     New values that are structures contain a pointer to the
  6595.                     class definition in the first element.  Subsequent
  6596.                     elements are various values in the order that they were
  6597.                     referenced.  
  6598.  
  6599.                                         Arrays
  6600.  
  6601.                     Array elements are normally accessed using square
  6602.                     brackets [].  But if you find reason, you can use
  6603.                     Word:At to get the element.  Unlike Structures, array
  6604.                     elements have no label, so the class will always be
  6605.                     null.   Using Class:At is legal, but will always return
  6606.                     null unless you used Class:AtPut to put a value there.
  6607.  
  6608.  
  6609.  
  6610.  
  6611.  
  6612.           Chapter Five - JORF Functions                                 101
  6613.  
  6614.  
  6615.  
  6616.  
  6617.  
  6618.  
  6619.  
  6620.                                          Text
  6621.  
  6622.                     Text lines may be examined to obtain the class and
  6623.                     values of items on that line.  The line is
  6624.                     automatically parsed when Class:At is used.  The parse
  6625.                     will automatically separate all words and punctuation
  6626.                     characters.  Each punctuation character is treated as a
  6627.                     separate word.  If the parsed line contains JORF-like
  6628.                     Class:Word pairs, then the class values will be set for
  6629.                     Class:At.
  6630.  
  6631.  
  6632.  
  6633.  
  6634.  
  6635.  
  6636.  
  6637.  
  6638.  
  6639.  
  6640.  
  6641.  
  6642.  
  6643.  
  6644.  
  6645.  
  6646.  
  6647.  
  6648.  
  6649.  
  6650.  
  6651.  
  6652.  
  6653.  
  6654.  
  6655.  
  6656.  
  6657.  
  6658.  
  6659.  
  6660.  
  6661.  
  6662.  
  6663.  
  6664.  
  6665.  
  6666.  
  6667.  
  6668.  
  6669.  
  6670.  
  6671.  
  6672.  
  6673.           The JORF Manual (Shareware Disk Version)                      102
  6674.  
  6675.  
  6676.  
  6677.  
  6678.  
  6679.  
  6680.  
  6681.  
  6682.                                      Class:AtPut
  6683.  
  6684.  
  6685.           Function  Class:AtPut ( Structure, Position, Class ) 
  6686.  
  6687.           Purpose   Changes the class of a word in a member of a structure.
  6688.  
  6689.  
  6690.           Returns   None.
  6691.  
  6692.           See Also  Class:At, Word:AtPut.
  6693.  
  6694.           Notes     Structures, Arrays, the JORF Stack and text lines are
  6695.                     all stored as an array of Class:Word pairs.  The number
  6696.                     of words can be obtained using Word:Len.  Although
  6697.                     Class:At works for both text and structures,
  6698.                     Class:AtPut works only on structures, not text lines. 
  6699.                     To change a text line, you must use the String
  6700.                     functions.
  6701.  
  6702.                     Class:AtPut can be used to change an element name in a
  6703.                     structure, or a variable name in the stack.  
  6704.  
  6705.  
  6706.  
  6707.  
  6708.  
  6709.  
  6710.  
  6711.  
  6712.  
  6713.  
  6714.  
  6715.  
  6716.  
  6717.  
  6718.  
  6719.  
  6720.  
  6721.  
  6722.  
  6723.  
  6724.  
  6725.  
  6726.  
  6727.  
  6728.  
  6729.  
  6730.  
  6731.  
  6732.  
  6733.  
  6734.           Chapter Five - JORF Functions                                 103
  6735.  
  6736.  
  6737.  
  6738.  
  6739.  
  6740.  
  6741.  
  6742.  
  6743.                                        Class:In
  6744.  
  6745.  
  6746.           Function  Class:In ( Structure, Class ) 
  6747.  
  6748.           Purpose   Searches for the existence of Class in a structure, and
  6749.                     returns the position if it is found.  Returns zero if
  6750.                     Class is not found.
  6751.  
  6752.           Returns   Position of Class or zero if not found.
  6753.  
  6754.           See Also  Class:At, Word:In.
  6755.  
  6756.           Notes     Both structures and text lines are stored as an array
  6757.                     of Class:Word pairs.  The number of words can be
  6758.                     obtained using Word:Len.  ClassIn can be used to see if
  6759.                     a member exists in a structure, without using the
  6760.                     structure pointer operator.
  6761.  
  6762.  
  6763.  
  6764.  
  6765.  
  6766.  
  6767.  
  6768.  
  6769.  
  6770.  
  6771.  
  6772.  
  6773.  
  6774.  
  6775.  
  6776.  
  6777.  
  6778.  
  6779.  
  6780.  
  6781.  
  6782.  
  6783.  
  6784.  
  6785.  
  6786.  
  6787.  
  6788.  
  6789.  
  6790.  
  6791.  
  6792.  
  6793.  
  6794.  
  6795.           The JORF Manual (Shareware Disk Version)                      104
  6796.  
  6797.  
  6798.  
  6799.  
  6800.  
  6801.  
  6802.  
  6803.  
  6804.                                        Date:Add
  6805.  
  6806.  
  6807.           Function  Date:Add ( Date, Days, Months, Years )  
  6808.  
  6809.           Purpose   Add the specified Days, Months, or Years to Date.
  6810.  
  6811.           Returns   A date.
  6812.  
  6813.           See Also  Date:Sub, Time:Add.
  6814.  
  6815.           Notes     This is a very specialized command that helps you
  6816.                     calculate one month after, or 90 days after a date. 
  6817.                     This command does all the  necessary calculations to
  6818.                     account for month lengths and leap years.  
  6819.                     Adding one month to 03/31 will result in 05/01, and not
  6820.                     04/30 as some people anticipate.
  6821.  
  6822.           Example   The CAL.J program displays a calendar and uses Date:Add
  6823.                     to add months as you press page down.
  6824.  
  6825.  
  6826.  
  6827.  
  6828.  
  6829.  
  6830.  
  6831.  
  6832.  
  6833.  
  6834.  
  6835.  
  6836.  
  6837.  
  6838.  
  6839.  
  6840.  
  6841.  
  6842.  
  6843.  
  6844.  
  6845.  
  6846.  
  6847.  
  6848.  
  6849.  
  6850.  
  6851.  
  6852.  
  6853.  
  6854.  
  6855.  
  6856.           Chapter Five - JORF Functions                                 105
  6857.  
  6858.  
  6859.  
  6860.  
  6861.  
  6862.  
  6863.  
  6864.  
  6865.  
  6866.           Class:Cal      | Declare class Calc
  6867.             Date         |
  6868.             Day          | Current day
  6869.             Month        | Current entry value
  6870.             Year         | Current year
  6871.             Row          | Current Row
  6872.             Col          | Current Col
  6873.             DspDay       | Last displayed day
  6874.             DspMonth     | Last displayed month
  6875.             DspYear      | Last displayed year
  6876.             DspRow       | Last displayed row
  6877.             DspCol       | Last displayed col
  6878.  
  6879.           Cal:start
  6880.             New(Cal:Cal)
  6881.             Cal->Date   = Date:Get
  6882.             Event:Add("Cal")
  6883.  
  6884.             Win:Add ("Calendar",0,0,9,20)
  6885.             Cal:Show(Cal)
  6886.             While (Ok)
  6887.               If (Kbd:Get()=='Esc_Key')
  6888.                 Break
  6889.             Return (Cal->Date)
  6890.  
  6891.           Cal:Ctrl_Page_Down_Key
  6892.             Cal->Date = Date:Add(Cal->Date,0,0,1)
  6893.             Cal:Show( Cal )
  6894.             Return (Ok)
  6895.  
  6896.           Cal:Ctrl_Page_Up_Key
  6897.             Cal->Date = Date:Sub(Cal->Date,0,0,1)
  6898.             Cal:Show( Cal )
  6899.             Return (Ok)
  6900.  
  6901.           Cal:Down_Arrow_Key
  6902.             Cal->Date = Date:Add(Cal->Date,7,0,0)
  6903.             Cal:Show( Cal )
  6904.             Return (Ok)
  6905.  
  6906.           Cal:End_Key
  6907.             Cal->Date = Date:Add(Cal->Date,6-(Date:Str(Cal->Date,'n')%7),0,0)
  6908.             Cal:Show( Cal )
  6909.             Return (Ok)
  6910.  
  6911.           Cal:Enter_Key
  6912.             Msg:Add
  6913.               Date is {Cal->Date}
  6914.             Return ("Esc_Key")
  6915.  
  6916.  
  6917.           The JORF Manual (Shareware Disk Version)                      106
  6918.  
  6919.  
  6920.  
  6921.  
  6922.  
  6923.  
  6924.  
  6925.           Cal:Home_Key
  6926.             Cal->Date = Date:Sub(Cal->Date,(Date:Str(Cal->Date,'n')%7),0,0)
  6927.             Cal:Show( Cal )
  6928.             Return (Ok)
  6929.  
  6930.           Cal:Left_Arrow_Key
  6931.             Cal->Date = Date:Sub(Cal->Date,1,0,0)
  6932.             Cal:Show( Cal )
  6933.             Return (Ok)
  6934.  
  6935.           Cal:Page_Down_Key
  6936.             Cal->Date = Date:Add(Cal->Date,0,1,0)
  6937.             Cal:Show( Cal )
  6938.             Return (Ok)
  6939.  
  6940.           Cal:Page_Up_Key
  6941.             Cal->Date = Date:Sub(Cal->Date,0,1,0)
  6942.             Cal:Show( Cal )
  6943.             Return (Ok)
  6944.  
  6945.           Cal:Right_Arrow_Key
  6946.             Cal->Date = Date:Add(Cal->Date,1,0,0)
  6947.             Cal:Show( Cal )
  6948.             Return (Ok)
  6949.  
  6950.           Cal:Show(Cal)
  6951.             New (Month, Day, Dow, Pos, Cnt, End)
  6952.  
  6953.             If (Date:Str(Cal->Date,'y') != Cal->DspYear)
  6954.               Cal->DspMonth=0
  6955.  
  6956.             If (Date:Str(Cal->Date,'m') != Cal->DspMonth)
  6957.               If (Cal->DspDay)
  6958.                 Move:To(Cal->DspRow,Cal->DspCol)
  6959.                 Str:Put(To:Str(Cal->DspDay,"##"))
  6960.                 Cal->DspDay=0
  6961.               Month=Date:Str(Cal->Date,"S")+' '+Date:Str(Cal->Date,"YYYY")
  6962.               Move:To(1,1)
  6963.               Str:Put(Str:AtSet(Null,1,' ',Win:Ptr->Wid))
  6964.               Move:To(1,(Win:Ptr->Wid-Str:Len(Month)+1)/2)
  6965.               Str:Put(Month)
  6966.               Move:To(2,1)
  6967.               Str:Put("____________________")
  6968.               Move:To(3,1)
  6969.               Str:Put("Su Mo Tu We Th Fr Sa")
  6970.               Dow  =Date:Str(Cal->Date,'n') % 7
  6971.               Day  =Date:Str(Cal->Date,'d')
  6972.               End  =Date:Add(Cal->Date,0,1)
  6973.               End  =Date:Sub(End,Day)
  6974.               End  =Date:Str(End,'d')
  6975.               Pos  =Date:Str(Date:Sub(Cal->Date,Day-1),'n') % 7
  6976.               Move:To (4,1)
  6977.  
  6978.           Chapter Five - JORF Functions                                 107
  6979.  
  6980.  
  6981.  
  6982.  
  6983.  
  6984.  
  6985.  
  6986.               Str:Put(Str:AtSet(Null,1,' ',Win:Ptr->Wid))
  6987.               For (Cnt = 1 thru End)
  6988.                 Move:To(0,(Pos*3)+1)
  6989.                 Str:Put(To:Str(Cnt,"##"))
  6990.                 ++Pos
  6991.                 If (Pos > 6)
  6992.                   Move:By(1,0)
  6993.                   Move:To(0,1)
  6994.                   Str:Put(Str:AtSet(Null,1,' ',Win:Ptr->Wid))
  6995.                   Move:To(0,1)
  6996.                   Pos=0
  6997.               If (Pos == 0 Or Win:Ptr->CurRow < 9)
  6998.                 Move:To (9,1)
  6999.                 Str:Put(Str:AtSet(Null,1,' ',Win:Ptr->Wid))
  7000.               Cal->DspYear  = Date:Str( Cal->Date, 'y' )
  7001.               Cal->DspMonth = Date:Str( Cal->Date, 'm' )
  7002.               Cal->DspDay   = 0
  7003.  
  7004.             If (Date:Str(Cal->Date,'d') != Cal->DspDay)
  7005.               If (Cal->DspDay)
  7006.                 Move:To(Cal->DspRow,Cal->DspCol)
  7007.                 Str:Put(To:Str(Cal->DspDay,"##"))
  7008.                 Cal->DspDay=0
  7009.               Day  =Date:Str( Cal->Date, 'd' )
  7010.               Dow  =Date:Str( Cal->Date, 'n' ) % 7
  7011.               Cal->DspDay = Day
  7012.               Cal->DspRow = 4 + To:Int( ( Day - Dow + 5) / 7 )
  7013.               Cal->DspCol = ( Dow * 3 ) + 1
  7014.  
  7015.               Win:Attr( 5 )
  7016.               Move:To( Cal->DspRow, Cal->DspCol )
  7017.               Str:Put( To:Str( Cal->DspDay, "##" ) )
  7018.               Win:Attr( 1 )
  7019.  
  7020.             Return(Ok)
  7021.  
  7022.           Cal:Up_Arrow_Key
  7023.             Cal->Date = Date:Sub(Cal->Date,7,0,0)
  7024.             Cal:Show( Cal )
  7025.             Return (Ok)
  7026.  
  7027.  
  7028.  
  7029.  
  7030.  
  7031.  
  7032.  
  7033.  
  7034.  
  7035.  
  7036.  
  7037.  
  7038.  
  7039.           The JORF Manual (Shareware Disk Version)                      108
  7040.  
  7041.  
  7042.  
  7043.  
  7044.  
  7045.  
  7046.  
  7047.  
  7048.                                        Date:Get
  7049.  
  7050.  
  7051.           Function  Date:Get 
  7052.  
  7053.           Purpose   Get system Date.
  7054.  
  7055.           Returns   A JORF pointer with the current system date.
  7056.  
  7057.           See Also  Date:Set.
  7058.  
  7059.           Notes     There is an internal data type for the date. 
  7060.                     Conversion to this type is done using the To:Date
  7061.                     function.  Conversion from this types done using
  7062.                     Date:Str.  These functions are paralleled for time.
  7063.  
  7064.  
  7065.  
  7066.  
  7067.  
  7068.  
  7069.  
  7070.  
  7071.  
  7072.  
  7073.  
  7074.  
  7075.  
  7076.  
  7077.  
  7078.  
  7079.  
  7080.  
  7081.  
  7082.  
  7083.  
  7084.  
  7085.  
  7086.  
  7087.  
  7088.  
  7089.  
  7090.  
  7091.  
  7092.  
  7093.  
  7094.  
  7095.  
  7096.  
  7097.  
  7098.  
  7099.  
  7100.           Chapter Five - JORF Functions                                 109
  7101.  
  7102.  
  7103.  
  7104.  
  7105.  
  7106.  
  7107.  
  7108.  
  7109.                                        Date:Set
  7110.  
  7111.  
  7112.           Function  Date:Set ( Date ) 
  7113.  
  7114.           Purpose   Set DOS clock to the specified date.
  7115.  
  7116.           Returns   None.
  7117.  
  7118.           See Also  Time:Set, To:Date.
  7119.  
  7120.           Notes     Sets the DOS date.  Date should be the result of the
  7121.                     To:Date function.  You can also specify a string value,
  7122.                     but the format will need to conform to the last format
  7123.                     you used in the To:Date function, or to MM/DD/YY if you
  7124.                     have not specified another format.
  7125.  
  7126.                     New programmers may note that JORF defaults to the
  7127.                     American MM/DD/YY format, but is easily changed to suit
  7128.                     European and Asian formats, as well as to create index
  7129.                     values using YYYY/MM/DD format.
  7130.  
  7131.                     Setting the DOS time and date does not always affect
  7132.                     the computer's system clock.  To permanently change the
  7133.                     time and date on your computer, you may have to use a
  7134.                     utility program.  Network computers often get their
  7135.                     date and time reset from the network file server. 
  7136.  
  7137.  
  7138.  
  7139.  
  7140.  
  7141.  
  7142.  
  7143.  
  7144.  
  7145.  
  7146.  
  7147.  
  7148.  
  7149.  
  7150.  
  7151.  
  7152.  
  7153.  
  7154.  
  7155.  
  7156.  
  7157.  
  7158.  
  7159.  
  7160.  
  7161.           The JORF Manual (Shareware Disk Version)                      110
  7162.  
  7163.  
  7164.  
  7165.  
  7166.  
  7167.  
  7168.  
  7169.  
  7170.                                      Date:SetFmt
  7171.  
  7172.  
  7173.           Function  Date:SetFmt ( FormatStructure )  
  7174.  
  7175.           Purpose   Changes the default Month and Weekday names for
  7176.                     Date:Str.
  7177.  
  7178.           Returns   None.
  7179.  
  7180.           See Also  Date:Str, Time:SetFmt.
  7181.  
  7182.           Notes     The structure may be any structure with the elements
  7183.                     specified below.  The Element values are parsed and
  7184.                     sorted in an internal static array.  Changing the
  7185.                     elements after setting them does not change the
  7186.                     internal array until you call Date:SetFmt again.  
  7187.  
  7188.                     This function does not return any values, but sets up
  7189.                     values for later use by Date:Str.
  7190.  
  7191.                     The structure values are as follows:
  7192.  
  7193.                     FormatStructure->Format       | Default MM/DD/YY format
  7194.  
  7195.                     FormatStructure->M1           | The name for January
  7196.                     FormatStructure->M2           | The name for February
  7197.                      . . .
  7198.                     FormatStructure->M12          | The name for December
  7199.  
  7200.                     FormatStructure->D1           | The name for Monday
  7201.                     FormatStructure->D2           | The name for Tuesday
  7202.                      . . .
  7203.                     FormatStructure->D7           | The name for Sunday
  7204.  
  7205.  
  7206.  
  7207.  
  7208.  
  7209.  
  7210.  
  7211.  
  7212.  
  7213.  
  7214.  
  7215.  
  7216.  
  7217.  
  7218.  
  7219.  
  7220.  
  7221.  
  7222.           Chapter Five - JORF Functions                                 111
  7223.  
  7224.  
  7225.  
  7226.  
  7227.  
  7228.  
  7229.  
  7230.  
  7231.           Example   This program displays a text box showing the various
  7232.                     time values, then switches to French (one of only two
  7233.                     foreign languages I know well enough to know all the
  7234.                     words, the other is Japanese, and you need a graphics
  7235.                     screen for that).
  7236.  
  7237.  
  7238.           TimeTest:Start
  7239.                       New Time
  7240.                       Win:Add ("Time Test", 0, 0, 10, 40, Here)
  7241.                       Time:Get (Time)
  7242.                       Str:PutLine ("NDate: " +Time->NDate)
  7243.                       Str:PutLine ("SDate: " +Time->SDate)
  7244.                       Str:PutLine ("STime: " +Time->STime)
  7245.                       Str:PutLine ("Switch to French")
  7246.                       Time->M1="Janvier"
  7247.                       Time->M2="Frevier"
  7248.                       Time->M3="Mars"
  7249.                       Time->M4="Avril"
  7250.                       Time->M5="Mai"
  7251.                       Time->M6="Jun"
  7252.                       Time->M7="Juillet"
  7253.                       Time->M8="Aout"
  7254.                       Time->M9="Septembre"
  7255.                       Time->M10="Octobre"
  7256.                       Time->M11="Novembre"
  7257.                       Time->M12="Decembre"
  7258.                       Time->NDFormat = "dd.mm.yy"
  7259.                       Time->SDFormat = "d m, y"
  7260.                       Time->STFormat = "h.m.s a"
  7261.                       Time:Get (Time)
  7262.                       Str:PutLine ("NDate: " +Time->NDate)
  7263.                       Str:PutLine ("SDate: " +Time->SDate)
  7264.                       Str:PutLine ("STime: " +Time->STime)
  7265.                       Win:Pause
  7266.                       Return
  7267.  
  7268.  
  7269.  
  7270.  
  7271.  
  7272.  
  7273.  
  7274.  
  7275.  
  7276.  
  7277.  
  7278.  
  7279.  
  7280.  
  7281.  
  7282.  
  7283.           The JORF Manual (Shareware Disk Version)                      112
  7284.  
  7285.  
  7286.  
  7287.  
  7288.  
  7289.  
  7290.  
  7291.  
  7292.                                        Date:Str
  7293.  
  7294.           Function  Date:Str ( Date, Format )  
  7295.  
  7296.           Purpose   Formats the date according to format.  You can also
  7297.                     obtain month name, day of week, and other partial date
  7298.                     information.
  7299.  
  7300.           Returns   A formatted string.
  7301.  
  7302.           See Also  Date:Get, Time:Str.
  7303.  
  7304.           Notes     The specified date should be the result of the To:Date
  7305.                     function that makes returns JORF pointer with an
  7306.                     internal date value. (The internal value stores the
  7307.                     date as a long integer value of the number of days
  7308.                     since the mythical date January 1, 00.  
  7309.  
  7310.                     The format is a string saying how to format the date. 
  7311.                     The following are special character within the format
  7312.                     string:
  7313.  
  7314.                                    Date Formatters
  7315.  
  7316.                     s    = String month      Caps makes string upper case
  7317.                     w    = String weekday    Caps makes string upper case
  7318.                     n    = Numeric weekday   Caps is ignored
  7319.                     m    = Month             Caps is ignored
  7320.                     mm   = Month, zero in front   Caps is ignored
  7321.                     d    = Day                    Caps is ignored
  7322.                     dd   = Day, zero in front     Caps is ignored
  7323.                     y    = Year                   Caps is ignored
  7324.                     yy   = Two digit year         Caps is ignored
  7325.                     yyyy = Four digit year        Caps is ignored
  7326.  
  7327.                     Any other characters are retained as-is. 
  7328.  
  7329.                     The following examples show how the date 10/13/92 would
  7330.                     be formatted:
  7331.  
  7332.                     Date:Str(Date,"MM/DD/YY")          result "10/13/92"
  7333.                     Date:Str(Date,"MM/DD")             result "10/13"
  7334.                     Date:Str(Date,"s d, yyyy")         result "October 13, 1992"
  7335.                     Date:Str(Date,"n-w"                result "2-Tuesday"
  7336.                     Date:Str(Date,"N-W")               result "2-TUESDAY"
  7337.  
  7338.                     You can easily change the table of month and weekday
  7339.                     names to other languages using the Date:SetFmt
  7340.                     function.  If the format is omitted, the default format
  7341.                     of "MM/DD/YY" is used.  This default can be changed
  7342.                     using Date:SetFmt.
  7343.  
  7344.           Chapter Five - JORF Functions                                 113
  7345.  
  7346.  
  7347.  
  7348.  
  7349.  
  7350.  
  7351.  
  7352.  
  7353.                                        Date:Sub
  7354.  
  7355.  
  7356.           Function  Date:Sub ( Date, Days, Months, Years )  
  7357.  
  7358.           Purpose   Subtract the specified Days, Months, or Years from the
  7359.                     Date.
  7360.  
  7361.           Returns   A date.
  7362.  
  7363.           See Also  Date:Add, Time:Sub.
  7364.  
  7365.           Notes     This is a very specialized command that helps you
  7366.                     calculate one month before, or 90 days before a date. 
  7367.                     This command does all the  necessary calculations to
  7368.                     account for month lengths and leap years.  
  7369.  
  7370.  
  7371.  
  7372.  
  7373.  
  7374.  
  7375.  
  7376.  
  7377.  
  7378.  
  7379.  
  7380.  
  7381.  
  7382.  
  7383.  
  7384.  
  7385.  
  7386.  
  7387.  
  7388.  
  7389.  
  7390.  
  7391.  
  7392.  
  7393.  
  7394.  
  7395.  
  7396.  
  7397.  
  7398.  
  7399.  
  7400.  
  7401.  
  7402.  
  7403.  
  7404.  
  7405.           The JORF Manual (Shareware Disk Version)                      114
  7406.  
  7407.  
  7408.  
  7409.  
  7410.  
  7411.  
  7412.  
  7413.  
  7414.                                       Db:Append
  7415.  
  7416.  
  7417.           Function  Db:Append ( FileName, Record )  
  7418.  
  7419.           Purpose   Append Record to the end of  FileName..
  7420.  
  7421.           Returns   Returns the record number of the new record appended to
  7422.                     the file.  If Record is a structure, the structure
  7423.                     values are written
  7424.  
  7425.           See Also  Db:Write.
  7426.  
  7427.           Notes     In dBASE land, the only way to append is to use the
  7428.                     command APPEND BLANK to append a blank record.  In JORF
  7429.                     land, you can append a filled record (structure) which
  7430.                     simplifies the process of locking and adding a record
  7431.                     to a dBASE file.  If you APPEND BLANK, you must
  7432.                     immediately lock the record before you set values and
  7433.                     write the final record.  When  you append a filled
  7434.                     record in the JORF style, locking is not required. 
  7435.  
  7436.                     (Locking is not required because the interpreter is
  7437.                     automatically handling file locks.  To append a record
  7438.                     in a network environment, the entire file is locked,
  7439.                     the record appended, and the file unlocked.) 
  7440.  
  7441.                     The Record is a JORF structure that contains fields
  7442.                     with dBASE names.  Each field is written to the file
  7443.                     into the like named dBASE field.  There must be a name
  7444.                     correspondence between the JORF structure and the dBASE
  7445.                     field name.  Although you can add new fields to JORF
  7446.                     structures very easily, you can only introduce new
  7447.                     fields into a dBASE file by rewriting that entire file.
  7448.  
  7449.           Example
  7450.  
  7451.           jcm2dbf:Start
  7452.             | Conversion program for ASP.JCM to ASP.DBF
  7453.             |
  7454.             New (SrcFile,DstFile,Recno,Contact)
  7455.             Jorf:File("Contact.J",Here)        | Read Class:Contact def
  7456.             SrcFile = "ASP.JCM"
  7457.             DstFile = "ASP.DBF"
  7458.  
  7459.             File:Del(DstFile)
  7460.             Db:Map (DstFile)                   | Need full mapping to create
  7461.               Name    dbType:"C" Len:30
  7462.               Title   dbType:"C" Len:30
  7463.               Company dbType:"C" Len:30
  7464.               Address dbType:"C" Len:30
  7465.  
  7466.           Chapter Five - JORF Functions                                 115
  7467.  
  7468.  
  7469.  
  7470.  
  7471.  
  7472.  
  7473.  
  7474.               City    dbType:"C" Len:20
  7475.               State   dbType:"C" Len:2
  7476.               Zip     dbType:"C" Len:10
  7477.               Country dbType:"C" Len:20
  7478.             Db:Create(DstFile)
  7479.             Jorf:File(SrcFile,Here)
  7480.             Win:Add("JCM to DBF File Converter",10, 10, 5, 35)
  7481.             Win:Msg("Press ESC to abort conversion.")
  7482.             Contact = Struct:Next("Contact", "FullName", Contact)
  7483.             While (Contact)
  7484.               ++Recno
  7485.               Move:To(2,2)
  7486.               Str:Put("Contact: {Recno}")
  7487.               Move:To(4,2)
  7488.               Str:Put("Name:   {Str:Pad(Contact->FullName,30)}")
  7489.               Jcm2Dbf:Add(DstFile,Contact)
  7490.               If (Kbd:Hit)
  7491.                 If (Kbd:Get=="Esc_Key")
  7492.                   Break
  7493.               Contact = Struct:Next("Contact", "FullName", Contact)
  7494.             Return (Ok)
  7495.  
  7496.           Jcm2Dbf:Add(DstFile,Contact)
  7497.             New (Record,CommaPos)
  7498.             Record->Name     = Contact->FullName
  7499.             Record->Company  = Contact->Company
  7500.             CommaPos = Str:In(Contact->Addr2,",")
  7501.             If (CommaPos)
  7502.               Record->Address  = Contact->Addr1
  7503.               Record->City = Str:At(Contact->Addr2,1,CommaPos-1)
  7504.               Record->State= Word:At(Str:At(Contact->Addr2,CommaPos+1),1)
  7505.             Else
  7506.               Record->Address  = Contact->Addr1+" "+Contact->Addr2
  7507.               CommaPos = Str:In(Contact->Addr3,",")
  7508.               Record->City = Str:At(Contact->Addr3,1,CommaPos-1)
  7509.               Record->State= Word:At(Str:At(Contact->Addr3,CommaPos+1),1)
  7510.             Record->Zip    = Contact->ZipCode
  7511.             Db:Append(DstFile,Record)
  7512.             Return (Ok)
  7513.  
  7514.  
  7515.  
  7516.  
  7517.  
  7518.  
  7519.  
  7520.  
  7521.  
  7522.  
  7523.  
  7524.  
  7525.  
  7526.  
  7527.           The JORF Manual (Shareware Disk Version)                      116
  7528.  
  7529.  
  7530.  
  7531.  
  7532.  
  7533.  
  7534.  
  7535.  
  7536.                                        Db:Close
  7537.  
  7538.  
  7539.           Function  Db:Close ( FileName )  
  7540.  
  7541.           Purpose   Explicit close for FileName..
  7542.  
  7543.           Returns   None.
  7544.  
  7545.           See Also  Other File functions.
  7546.  
  7547.           Notes     You do not have to close files in the JORF language.  A
  7548.                     Mapped file is closed according to the Level specified
  7549.                     in the mapping.  Files that are renamed or deleted are
  7550.                     automatically closed prior to the renaming.
  7551.  
  7552.                     This function exists because I might have forgotten a
  7553.                     spot where a file should be closed before further
  7554.                     handling.  
  7555.  
  7556.  
  7557.  
  7558.  
  7559.  
  7560.  
  7561.  
  7562.  
  7563.  
  7564.  
  7565.  
  7566.  
  7567.  
  7568.  
  7569.  
  7570.  
  7571.  
  7572.  
  7573.  
  7574.  
  7575.  
  7576.  
  7577.  
  7578.  
  7579.  
  7580.  
  7581.  
  7582.  
  7583.  
  7584.  
  7585.  
  7586.  
  7587.  
  7588.           Chapter Five - JORF Functions                                 117
  7589.  
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.  
  7597.                                       Db:Create
  7598.  
  7599.  
  7600.           Function  Db:Create ( FileName )  
  7601.  
  7602.           Purpose   Create a new dBASE file..
  7603.  
  7604.           Returns   Ok if file is created, Null if not.
  7605.  
  7606.           See Also  File:Create.
  7607.  
  7608.           Notes     If the file exists, it will be deleted.  The file will
  7609.                     then be created and the dBASE header written.  If there
  7610.                     are index (NTX) files declared in the mapping, they
  7611.                     will also be deleted and created anew. 
  7612.  
  7613.                     dBASE files have a distinctive file header that is
  7614.                     created with this command.  You cannot write to a dBASE
  7615.                     file without first creating the header.  This is
  7616.                     different than with ASCII delimited files which have no
  7617.                     header and can be written without "Creating".
  7618.  
  7619.                     The created file will be dBASE III, not dBASE II or
  7620.                     dBASE IV format.  
  7621.  
  7622.           Example   See Db:Append.
  7623.  
  7624.  
  7625.  
  7626.  
  7627.  
  7628.  
  7629.  
  7630.  
  7631.  
  7632.  
  7633.  
  7634.  
  7635.  
  7636.  
  7637.  
  7638.  
  7639.  
  7640.  
  7641.  
  7642.  
  7643.  
  7644.  
  7645.  
  7646.  
  7647.  
  7648.  
  7649.           The JORF Manual (Shareware Disk Version)                      118
  7650.  
  7651.  
  7652.  
  7653.  
  7654.  
  7655.  
  7656.  
  7657.  
  7658.                                       Db:Delete
  7659.  
  7660.  
  7661.           Function  Db:Delete ( FileName, Record ) 
  7662.  
  7663.           Purpose   Mark a record as "Deleted"
  7664.  
  7665.           Returns   Ok if deleted, Null if record was already deleted or
  7666.                     was not available to delete.
  7667.  
  7668.           See Also  Db:Recall, Db:Lock, Other DB functions.
  7669.  
  7670.           Notes     Before deleting, the Record must have been found, read
  7671.                     and locked.  The actual value for Record can be either
  7672.                     the Recno integer value returned by Db:Seek, or the
  7673.                     Structure value returned by Db:Lock. This command can
  7674.                     then be used to "Delete" the record.
  7675.  
  7676.                     In dBASE land, records are not eliminated when they are
  7677.                     "Deleted".  Instead, they are marked for deletion
  7678.                     during the next PACK.  Until the file is packed, the
  7679.                     records will stay around and can be restored using
  7680.                     Db:Recall at any time.
  7681.  
  7682.                     Deleting a record will change the actions of Db:Seek,
  7683.                     Db:Go and Db:Skip.  These functions automatically skip
  7684.                     right by "Deleted" records.  You can change this action
  7685.                     by setting the "Deleted" option on using Db:Set.
  7686.  
  7687.  
  7688.  
  7689.  
  7690.  
  7691.  
  7692.  
  7693.  
  7694.  
  7695.  
  7696.  
  7697.  
  7698.  
  7699.  
  7700.  
  7701.  
  7702.  
  7703.  
  7704.  
  7705.  
  7706.  
  7707.  
  7708.  
  7709.  
  7710.           Chapter Five - JORF Functions                                 119
  7711.  
  7712.  
  7713.  
  7714.  
  7715.  
  7716.  
  7717.  
  7718.  
  7719.                                         Db:Go
  7720.  
  7721.  
  7722.           Function  Db:Go ( Name, Pos ) 
  7723.  
  7724.           Purpose   Move the record pointer in a dBASE file.
  7725.  
  7726.           Returns   Record number.   Null if unsuccessful.
  7727.  
  7728.           See Also  Db:Skip, Db:NtxOrd, Other DB functions.
  7729.  
  7730.           Notes     Pos may be "Top" or "Bottom" to return the first or
  7731.                     last record number of the file.  Pos may also be any
  7732.                     record number.  The first record number is record
  7733.                     number 1.  The last record number can be obtained using
  7734.                     Db:Go("Myfile.dbf", "Top").
  7735.  
  7736.                     The returned value is an integer value.  If you are
  7737.                     going to change the data, you should read it using
  7738.                     Db:Lock. If you are reading the file for information or
  7739.                     display only, you can red the record using  Db:Read.
  7740.  
  7741.                     This function is the equivalent of the dBASE "GO" and
  7742.                     "GOTO" commands.  The expression Db:Go("MyFile.dbf",
  7743.                     "Bottom") returns the same value as the clipper
  7744.                     LASTREC() function.
  7745.  
  7746.  
  7747.  
  7748.  
  7749.  
  7750.  
  7751.  
  7752.  
  7753.  
  7754.  
  7755.  
  7756.  
  7757.  
  7758.  
  7759.  
  7760.  
  7761.  
  7762.  
  7763.  
  7764.  
  7765.  
  7766.  
  7767.  
  7768.  
  7769.  
  7770.  
  7771.           The JORF Manual (Shareware Disk Version)                      120
  7772.  
  7773.  
  7774.  
  7775.  
  7776.  
  7777.  
  7778.  
  7779.  
  7780.                                        Db:Info
  7781.  
  7782.  
  7783.           Function  Db:Info ( Name, InfoStructure ) 
  7784.  
  7785.           Purpose   Get information from the dBASE file header and current
  7786.                     record.
  7787.  
  7788.           Returns   InfoStructure, or Mem:Ptr if InfoStructure was null.
  7789.  
  7790.           See Also  Other DB Functions.
  7791.  
  7792.           Notes     Sets elements in Infostructure.  That means that
  7793.                     InfoStructure needs to have these elements declared, or
  7794.                     must be a structure of the Jorf class that accept any
  7795.                     elements.  If you omit InfoStructure as I usually do,
  7796.                     then the global value Mem:Ptr is used.
  7797.  
  7798.                     The element values are:
  7799.  
  7800.                          LastRec   Last record number
  7801.                          Found     Whether last Db:Seek worked
  7802.                          Eof       File read or seek is at end of file
  7803.                          Bof       File read or seek is at beginning
  7804.                          Deleted   Current record is deleted
  7805.  
  7806.  
  7807.  
  7808.  
  7809.  
  7810.  
  7811.  
  7812.  
  7813.  
  7814.  
  7815.  
  7816.  
  7817.  
  7818.  
  7819.  
  7820.  
  7821.  
  7822.  
  7823.  
  7824.  
  7825.  
  7826.  
  7827.  
  7828.  
  7829.  
  7830.  
  7831.  
  7832.           Chapter Five - JORF Functions                                 121
  7833.  
  7834.  
  7835.  
  7836.  
  7837.  
  7838.  
  7839.  
  7840.  
  7841.                                        Db:Lock
  7842.  
  7843.  
  7844.           Function  Db:Lock ( Name, Record ) 
  7845.  
  7846.           Purpose   Lock a record in a dBASE file..
  7847.  
  7848.           Returns   Contents of record.  Null if unsuccessful.
  7849.  
  7850.           See Also  Db:Skip, Db:Goto, Other DB functions.
  7851.  
  7852.           Notes     This command works just like DB:Read except that it
  7853.                     locks the record before reading.  The record remains
  7854.                     locked until a Db:Write or Db:Unlock on the same
  7855.                     record.
  7856.  
  7857.                     The returned value is a Jorf structure that holds the
  7858.                     dBASE record format.  The structure is a member of the
  7859.                     class declared in Db:Map.  An additional member to that
  7860.                     structure is the record number held in an element
  7861.                     called Jrecno.  
  7862.  
  7863.  
  7864.  
  7865.  
  7866.  
  7867.  
  7868.  
  7869.  
  7870.  
  7871.  
  7872.  
  7873.  
  7874.  
  7875.  
  7876.  
  7877.  
  7878.  
  7879.  
  7880.  
  7881.  
  7882.  
  7883.  
  7884.  
  7885.  
  7886.  
  7887.  
  7888.  
  7889.  
  7890.  
  7891.  
  7892.  
  7893.           The JORF Manual (Shareware Disk Version)                      122
  7894.  
  7895.  
  7896.  
  7897.  
  7898.  
  7899.  
  7900.  
  7901.  
  7902.                                         Db:Map
  7903.  
  7904.  
  7905.           Function  Db:Map ( Name, Level, Class, Map ) 
  7906.  
  7907.           Purpose   Declare dBASE file, map fields for file creation..
  7908.  
  7909.           Returns   None.
  7910.  
  7911.           See Also  Db:Create, Db:Read.
  7912.  
  7913.           Notes     Map a file for use with Db:Read and Db:Create.  The
  7914.                     action of this command differs between reading an
  7915.                     existing file and creating a new dBASE file.
  7916.  
  7917.                     The parameter name is sets the file name.  Once mapped,
  7918.                     all reads and writes to that file will be influenced by
  7919.                     the mapping.
  7920.  
  7921.                     The parameter Class sets the structure type assigned to
  7922.                     a record when it is read from the file.  If no Class is
  7923.                     declared, the JORF class will be used (Structures in
  7924.                     the JORF class can accept any elements, there is no
  7925.                     checking for legal element values).
  7926.  
  7927.                     The last parameter is usually an indented section that
  7928.                     contains the field mapping.  The dBASE file format has
  7929.                     a file header which declares the fields in the file. 
  7930.                     If you map an existing file, your field names will be
  7931.                     ignored if they differ from the field names in the file
  7932.                     header.  
  7933.  
  7934.                     For  this reason, you must be sure to map existing
  7935.                     files according to the correct names and field lengths. 
  7936.                     When you are reading a dBASE file, if there is any
  7937.                     difference between the map and the header, the header
  7938.                     takes precedence and the map values are ignored.  When
  7939.                     reading a dBASE file, it is common to omit the mapping
  7940.                     entirely, and depend on the field definitions in the
  7941.                     header.  You can see this in the DBF2JCM.J example
  7942.                     program.
  7943.  
  7944.                     When you create a new dBASE file, you must map every
  7945.                     field.  Fields that you don't map will not be included
  7946.                     in the new header of the file.  You can see an example
  7947.                     of this in the JCM2DBF.J example program.
  7948.  
  7949.                     It is generally best to define the Len, dbName (the
  7950.                     name of the field in the dBase file).  You can also
  7951.                     define the Dec for decimal point, and dtype for the
  7952.                     dBase field type.  If you do not define these the
  7953.  
  7954.           Chapter Five - JORF Functions                                 123
  7955.  
  7956.  
  7957.  
  7958.  
  7959.  
  7960.  
  7961.  
  7962.                     decimal places will default to zero, and the dbType
  7963.                     will default to 'C' for the dBase Character type.
  7964.  
  7965.                     When mapping a dBASE file, you can also map the NTX
  7966.                     indexes for the file.  JORF uses Clipper style NTX
  7967.                     indexes, and not dBASE or FoxBASE style NDX indexes. 
  7968.                     The NTX format is quite different than NDX format, so
  7969.                     don't try to rename the file and expect it to work.
  7970.  
  7971.                     Contact:CvtDBASE
  7972.                       New (Contact:Contact,FName,Counter)
  7973.                       FName="MyFile.Dat"
  7974.                       | Add a window to show what is happening
  7975.                       Win:Add ("Reading {FName}", 0, 0, 10, 76, Here)
  7976.                       Db:Map (Fname,Here,"DBASE","Contact")
  7977.                         Company   Len:40 dbType:"C" dbName:"COMPANY"
  7978.                         Addr1     Len:40 dbType:"C" dbName:"ADDR1"
  7979.                         Addr2     Len:40 dbType:"C" dbName:"ADDR2"
  7980.                         Addr3     Len:40 dbType:"C" dbName:"CITSTZ"
  7981.                         Junk      Len:20 dbType:"C" dbName:"CODES"
  7982.                         FullName  Len:40 dbType:"C" dbName:"CONTACT"
  7983.                         Zip       Len:10 dbType:"C" dbName:"ZIP"
  7984.                       For (Counter = 1 thru Db:Go(Fname,"Bottom"))
  7985.                         Contact=Db:Read(Fname,Counter)
  7986.                         Str:Put (Str:Pad(Counter,4))
  7987.                         Str:Put (Str:Pad(Contact->Company,30))
  7988.                         Str:Put (Str:Pad(Contact->FullName,30))
  7989.                         Str:PutLine
  7990.                         Jorf:Write(Contact)
  7991.                       Return Ok
  7992.  
  7993.  
  7994.                     To define an index, your map line must definition must
  7995.                     begin with the key expression "NTX" followed by a colon
  7996.                     and the name of the index.  You only need the file
  7997.                     name, the path is assumed to be the same directory as
  7998.                     the base dBASE file.
  7999.  
  8000.                     The JORF interpreter needs enough information to
  8001.                     interpret the index values.  When using NTX indexes in
  8002.                     JORF, it is best to declare the index length and
  8003.                     constructor string.  If you omit this information, the
  8004.                     JORF interpreter will try to obtain the information
  8005.                     from the index header.
  8006.  
  8007.                     An index constructor string is maintained in each NTX
  8008.                     file header.  If the index key is a simple field, then
  8009.                     the string is simply the field name.  If the index key
  8010.                     contains any dBASE expressions, however, you must tell
  8011.                     the interpreter how to construct the equivalent key
  8012.                     using JORF expressions.  Examples are:
  8013.  
  8014.  
  8015.           The JORF Manual (Shareware Disk Version)                      124
  8016.  
  8017.  
  8018.  
  8019.  
  8020.  
  8021.  
  8022.  
  8023.                     dBASE Key      JORF Key
  8024.                     Name           Name              | Same
  8025.                     Name+Zip       Name+Zip          | Same
  8026.                     Dtos(StDate)   Date:Str(StDate,"YYYYMMDD")  | Different
  8027.  
  8028.  
  8029.                     The key thing to remember is that the JORF language is
  8030.                     different from the dBASE language, and you must
  8031.                     translate any complex key expression to the appropriate
  8032.                     JORF language expressions.
  8033.  
  8034.  
  8035.  
  8036.  
  8037.  
  8038.  
  8039.  
  8040.  
  8041.  
  8042.  
  8043.  
  8044.  
  8045.  
  8046.  
  8047.  
  8048.  
  8049.  
  8050.  
  8051.  
  8052.  
  8053.  
  8054.  
  8055.  
  8056.  
  8057.  
  8058.  
  8059.  
  8060.  
  8061.  
  8062.  
  8063.  
  8064.  
  8065.  
  8066.  
  8067.  
  8068.  
  8069.  
  8070.  
  8071.  
  8072.  
  8073.  
  8074.  
  8075.  
  8076.           Chapter Five - JORF Functions                                 125
  8077.  
  8078.  
  8079.  
  8080.  
  8081.  
  8082.  
  8083.  
  8084.  
  8085.                                       Db:NtxOrd
  8086.  
  8087.  
  8088.           Function  Db:NtxOrd ( Name, NtxNumber ) 
  8089.  
  8090.           Purpose   Switch indexes in an open file..
  8091.  
  8092.           Returns   None.
  8093.  
  8094.           See Also  Db:Skip.
  8095.  
  8096.           Notes     If you have declared indexes using Db:Map, you can use
  8097.                     this function to select which index to use for the next
  8098.                     Db:Skip.  
  8099.  
  8100.                     The first declared index is 1.  If you indicate an
  8101.                     NtxNumber of zero, no index is declared and Db:Skip
  8102.                     will be based on the natural order of the records. 
  8103.  
  8104.  
  8105.  
  8106.  
  8107.  
  8108.  
  8109.  
  8110.  
  8111.  
  8112.  
  8113.  
  8114.  
  8115.  
  8116.  
  8117.  
  8118.  
  8119.  
  8120.  
  8121.  
  8122.  
  8123.  
  8124.  
  8125.  
  8126.  
  8127.  
  8128.  
  8129.  
  8130.  
  8131.  
  8132.  
  8133.  
  8134.  
  8135.  
  8136.  
  8137.           The JORF Manual (Shareware Disk Version)                      126
  8138.  
  8139.  
  8140.  
  8141.  
  8142.  
  8143.  
  8144.  
  8145.  
  8146.                                        Db:Pack
  8147.  
  8148.  
  8149.           Function  Db:Pack ( Name, Showit ) 
  8150.  
  8151.           Purpose   Pack a dBASE file, DBT text file and re-write NTX
  8152.                     indexes.
  8153.  
  8154.           Returns   False if File could not be locked for packing. 
  8155.                     Otherwise Ok.
  8156.  
  8157.           See Also  Db:Map. 
  8158.  
  8159.           Notes     While most JORF dBASE commands work like their dBASE
  8160.                     cousins, this one is an improvement over the dBASE PACK
  8161.                     function.  In JORF, this command rewrites the entire
  8162.                     file, insuring a complete rewrite before the original
  8163.                     file is deleted.  For that reason, enough disk space is
  8164.                     required to hold the entire new copy of the file. 
  8165.                     After the file is rewritten and renamed, it is
  8166.                     automatically reindexed based on the declared indexes. 
  8167.  
  8168.                     Programmers not familiar with dBASE files should note: 
  8169.                     In dBASE-Land, records are not really deleted.  When
  8170.                     you delete a record using Db:Del, that record continues
  8171.                     to take space in the file until the file is packed. 
  8172.                     The pack function recovers the space used by the record
  8173.                     because it rewrites only un-deleted records in the new
  8174.                     version of the file.  For this reason, all dBASE
  8175.                     programs feature pack functions prominently, because
  8176.                     without them the files grow endlessly.
  8177.  
  8178.                     Programmers familiar with DBT files may note that JORF
  8179.                     uses DBT files just like Clipper, reusing the existing
  8180.                     space if possible, but allocating new blocks if the
  8181.                     memo field grows beyond the current 512 block boundary. 
  8182.                     Previously used memo blocks continue to take space
  8183.                     until a file is packed. 
  8184.  
  8185.                     If Showit is True, the Db:Pack function will display a
  8186.                     status box while writing and re-indexing the file.
  8187.  
  8188.           Example   See Db:Map.
  8189.  
  8190.  
  8191.  
  8192.  
  8193.  
  8194.  
  8195.  
  8196.  
  8197.  
  8198.           Chapter Five - JORF Functions                                 127
  8199.  
  8200.  
  8201.  
  8202.  
  8203.  
  8204.  
  8205.  
  8206.  
  8207.                                        Db:Read
  8208.  
  8209.  
  8210.           Function  Db:Read ( FileName, Recno ) 
  8211.  
  8212.           Purpose   Read a record from a dBASE III file..
  8213.  
  8214.           Returns   The record that was read.
  8215.  
  8216.           See Also  Db:Seek. Db:Goto, Db:Lock.  Other DB Functions.
  8217.  
  8218.           Notes     The Db:Read function is used to read a record obtained
  8219.                     using one of the record pointer moving functions
  8220.                     Db:Seek, Db:Skip and Db:Goto.  If Recno is omitted,
  8221.                     then the record number returned by these functions will
  8222.                     be used.  In dBASE land, this is called the "Current"
  8223.                     record number.  In JORF land, structures are known more
  8224.                     by their pointer nature and more than one structure of
  8225.                     the same class may be "Current".
  8226.  
  8227.  
  8228.  
  8229.  
  8230.  
  8231.  
  8232.  
  8233.  
  8234.  
  8235.  
  8236.  
  8237.  
  8238.  
  8239.  
  8240.  
  8241.  
  8242.  
  8243.  
  8244.  
  8245.  
  8246.  
  8247.  
  8248.  
  8249.  
  8250.  
  8251.  
  8252.  
  8253.  
  8254.  
  8255.  
  8256.  
  8257.  
  8258.  
  8259.           The JORF Manual (Shareware Disk Version)                      128
  8260.  
  8261.  
  8262.  
  8263.  
  8264.  
  8265.  
  8266.  
  8267.  
  8268.                                       Db:Recall
  8269.  
  8270.  
  8271.           Function  Db:Recall ( Name, Record ) 
  8272.  
  8273.           Purpose   Un-mark a "Deleted" record.
  8274.  
  8275.           Returns   Ok if record was properly unmarked. Null if record was
  8276.                     not previously "Deleted".
  8277.  
  8278.           See Also  Db:Del, Db:Lock, Other DB functions.
  8279.  
  8280.           Notes     You will have to set "Deleted" to True just to seek or
  8281.                     goto a "Deleted" record.  Once you have, you can
  8282.                     "Un-delete" the record with this function.  
  8283.  
  8284.                     This function is the equivalent of the dBASE RECALL
  8285.                     command.
  8286.  
  8287.  
  8288.  
  8289.  
  8290.  
  8291.  
  8292.  
  8293.  
  8294.  
  8295.  
  8296.  
  8297.  
  8298.  
  8299.  
  8300.  
  8301.  
  8302.  
  8303.  
  8304.  
  8305.  
  8306.  
  8307.  
  8308.  
  8309.  
  8310.  
  8311.  
  8312.  
  8313.  
  8314.  
  8315.  
  8316.  
  8317.  
  8318.  
  8319.  
  8320.           Chapter Five - JORF Functions                                 129
  8321.  
  8322.  
  8323.  
  8324.  
  8325.  
  8326.  
  8327.  
  8328.  
  8329.                                        Db:Seek
  8330.  
  8331.  
  8332.           Function  Db:Seek ( FileName, Keyvalue ) 
  8333.  
  8334.           Purpose   Searches the index for key value.
  8335.  
  8336.           Returns   Record number of record.  Null if match was not found..
  8337.  
  8338.           See Also  Db:Skip, Db:NtxOrd, Other DB functions.
  8339.  
  8340.           Notes     Searches for an index match to Keyvalue.  To seek, you
  8341.                     must have declared indexes and be set to the correct
  8342.                     index using Db:NtxOrd.  If you attempt to seek without
  8343.                     a valid index in use, Null will be returned.
  8344.  
  8345.                     The Db:Set function can change the nature of the seek. 
  8346.                     If you set "Deleted" to TRUE, then this function may
  8347.                     return the record number of a deleted record.  If
  8348.                     "SoftSeek" is true then this function may return the
  8349.                     next higher record if the exact Keyvalue is not found.
  8350.  
  8351.                     The returned value is an integer record number.  If you
  8352.                     are going to change the record, use Db:Lock to read it. 
  8353.                     If you are just looking at the data, use Db:Read.  
  8354.  
  8355.                     This function is the equivalent of the dBASE "SEEK"
  8356.                     command.
  8357.  
  8358.           Example   See Db:Read
  8359.  
  8360.  
  8361.  
  8362.  
  8363.  
  8364.  
  8365.  
  8366.  
  8367.  
  8368.  
  8369.  
  8370.  
  8371.  
  8372.  
  8373.  
  8374.  
  8375.  
  8376.  
  8377.  
  8378.  
  8379.  
  8380.  
  8381.           The JORF Manual (Shareware Disk Version)                      130
  8382.  
  8383.  
  8384.  
  8385.  
  8386.  
  8387.  
  8388.  
  8389.  
  8390.                                         Db:Set
  8391.  
  8392.  
  8393.           Function  Db:Set ( Name, Option, Value ) 
  8394.  
  8395.           Purpose   Do dBASE style "Set" functions that influence DB
  8396.                     commands.
  8397.  
  8398.           Returns   Prior setting.
  8399.  
  8400.           See Also  Db:Info, Other DB Functions.
  8401.  
  8402.           Notes     The dBASE language has numerous global settings that
  8403.                     are declared using the dBASE SET function.  In JORF,
  8404.                     two settings were needed to implement the most
  8405.                     rudimentary dBASE capability.  More SET commands may be
  8406.                     added later.
  8407.  
  8408.  
  8409.                     The current Options that may be set are:
  8410.  
  8411.                          "Deleted" True or False  Default False
  8412.                          "SoftSeek"     True or False  Default False
  8413.  
  8414.                     When "Deleted" is True, functions like Db:Go and
  8415.                     Db:Seek will go to and seek to deleted records as if
  8416.                     they were not deleted.  A deleted record in dBASE is
  8417.                     not really deleted until you PACK the file - so you can
  8418.                     freely set "Deleted" False and then read and undelete
  8419.                     the record. 
  8420.  
  8421.                     When "SoftSeek" is True, the Db:Seek function will seek
  8422.                     to the next higher key value in the file.  If it is
  8423.                     False, Db:Seek will return null if the exact key (to
  8424.                     the length of the key) is not found.  SoftSeek is
  8425.                     usually False for relational look ups (Key look-ups
  8426.                     into related data bases), but true for any screen
  8427.                     display or user oriented look-up, so the operator may
  8428.                     see close matches even after misspelling the key value.
  8429.  
  8430.  
  8431.  
  8432.  
  8433.  
  8434.  
  8435.  
  8436.  
  8437.  
  8438.  
  8439.  
  8440.  
  8441.  
  8442.           Chapter Five - JORF Functions                                 131
  8443.  
  8444.  
  8445.  
  8446.  
  8447.  
  8448.  
  8449.  
  8450.  
  8451.                                        Db:Skip
  8452.  
  8453.  
  8454.           Function  Db:Skip ( Name, Record, SkipBy ) 
  8455.  
  8456.           Purpose   Move the record pointer in a dBASE file.
  8457.  
  8458.           Returns   Record number of next record.  Null if unsuccessful.
  8459.  
  8460.           See Also  Db:Go, Db:NtxOrd, Other DB functions.
  8461.  
  8462.           Notes     This function is used to traverse records in a data
  8463.                     base.  Normally SkipBy is 1 (this is the default if it
  8464.                     is omitted) and this function returns the next record
  8465.                     in the file.  If the end of file is reached, then the
  8466.                     return value will be Null.
  8467.  
  8468.                     You can also declare a SkipBy value of -1 (negative
  8469.                     one) to read the previous record in the file.  You can
  8470.                     skip though the file by any number of records, positive
  8471.                     or negative.
  8472.  
  8473.                     The "Next" record is influenced by whether NTX indexes
  8474.                     are declared and which one is in use.  If there is an
  8475.                     active index, the next record will be chosen according
  8476.                     to the key value.  If there are no active indexes, or
  8477.                     if Db:NtxOrd is zero, then the next record will be the
  8478.                     next physical record in the dBASE file.
  8479.  
  8480.                     If Record is null and SkipBy is positive, the first
  8481.                     record is read just as if you used
  8482.                     Db:Go("MyFile.DBF","Top").  If the SkipBy is negative,
  8483.                     the last record is read as if you started with
  8484.                     "Bottom".
  8485.  
  8486.                     The return value is the record as read from the disk. 
  8487.                     If you are going to change the record, you should lock
  8488.                     the record and use the return value from Db:Lock to get
  8489.                     the most recent version of the record.
  8490.  
  8491.           Example   See Db:Read
  8492.  
  8493.  
  8494.  
  8495.  
  8496.  
  8497.  
  8498.  
  8499.  
  8500.  
  8501.  
  8502.  
  8503.           The JORF Manual (Shareware Disk Version)                      132
  8504.  
  8505.  
  8506.  
  8507.  
  8508.  
  8509.  
  8510.  
  8511.  
  8512.                                       Db:Unlock
  8513.  
  8514.  
  8515.           Function  Db:Unlock ( Name, Record ) 
  8516.  
  8517.           Purpose   Unlock a record in a dBASE file..
  8518.  
  8519.           Returns   Ok if record was locked.  Null if not locked.
  8520.  
  8521.           See Also  Db:Lock, Db:Write, Other DB functions.
  8522.  
  8523.           Notes     When you are using a record in a multi-user environment
  8524.                     you must lock the record while it is being changed.  To
  8525.                     lock a record, use Db:Lock.  To write the record and
  8526.                     unlock it, use Db:Write.  But if the operator aborts
  8527.                     the edit, you need to unlock the record and restore the
  8528.                     original values that the operator may have changed. 
  8529.                     That is the purpose of this function.
  8530.  
  8531.                     This function re-reads the record and unlocks it in
  8532.                     that order.  This is the proper process for handling an
  8533.                     aborted edit of a record on a multiuser system.  
  8534.  
  8535.                     To find the appropriate spot in the file, the Record
  8536.                     must have a valid Jrecno element.  This element is
  8537.                     automatically created by any of the DB functions that
  8538.                     read records.
  8539.  
  8540.           Example   See Db:Read
  8541.  
  8542.  
  8543.  
  8544.  
  8545.  
  8546.  
  8547.  
  8548.  
  8549.  
  8550.  
  8551.  
  8552.  
  8553.  
  8554.  
  8555.  
  8556.  
  8557.  
  8558.  
  8559.  
  8560.  
  8561.  
  8562.  
  8563.  
  8564.           Chapter Five - JORF Functions                                 133
  8565.  
  8566.  
  8567.  
  8568.  
  8569.  
  8570.  
  8571.  
  8572.  
  8573.                                        Db:Write
  8574.  
  8575.  
  8576.           Function  Db:Write ( Name, Record ) 
  8577.  
  8578.           Purpose   Write a Record to a disk file.
  8579.  
  8580.           Returns   None.
  8581.  
  8582.           See Also  Db:Append.
  8583.  
  8584.           Notes     Writes an existing record to the file, unlocks the
  8585.                     record.  To write a new record, you must use Db:Append. 
  8586.  
  8587.  
  8588.                     Unlike dBASE, which writes to the "Current" record
  8589.                     number (The last value returned by a SEEK or GO
  8590.                     command), JORF stores the record number in the record
  8591.                     structure.  When a record is written, it will be
  8592.                     written to the record where it was read, regardless of
  8593.                     whether the "Current" record has since changed.  JORF
  8594.                     allows you to have more than one record active at a
  8595.                     time, even in dBASE files.
  8596.  
  8597.                     The Db:Write function defines a physical write
  8598.                     operation like the dBASE COMMIT function.  There is no
  8599.                     need to "Replace With" in the JORF language as there to
  8600.                     set fields in dBASE.
  8601.  
  8602.  
  8603.  
  8604.  
  8605.  
  8606.  
  8607.  
  8608.  
  8609.  
  8610.  
  8611.  
  8612.  
  8613.  
  8614.  
  8615.  
  8616.  
  8617.  
  8618.  
  8619.  
  8620.  
  8621.  
  8622.  
  8623.  
  8624.  
  8625.           The JORF Manual (Shareware Disk Version)                      134
  8626.  
  8627.  
  8628.  
  8629.  
  8630.  
  8631.  
  8632.  
  8633.  
  8634.                                    DirList:GetFile
  8635.  
  8636.  
  8637.           Function  DirList:GetFile ( Wildcard, ExclusionLIst )  
  8638.  
  8639.           Purpose   Display "DialogDirList" box for file name..
  8640.  
  8641.           Returns   File name selected, or Null if Cancelled.
  8642.  
  8643.           See Also  DirList.J source file.
  8644.  
  8645.           Notes     This is a JORF language function that has become a
  8646.                     permanent part of the interpreter.  The source code to
  8647.                     this function is entirely contained in the DIRLIST.J
  8648.                     source file.  
  8649.  
  8650.                     This function asks for file name and path, while
  8651.                     displaying selection lists for both.  The display is
  8652.                     designed to look somewhat like Windows' DlgDirList box,
  8653.                     but does not use DlgdirList even under MS-WIndows.  
  8654.  
  8655.                     The WildCard and ExclusionList are used as document in
  8656.                     the Arr:Dir function.  The wildcard is used to choose
  8657.                     files to display, and the exclusion list insures that
  8658.                     inappropriate files are not displayed.  
  8659.  
  8660.           Example   The TEXTEDIT.J sample program makes good use of the
  8661.                     DirList:GetFile function.
  8662.  
  8663.  
  8664.  
  8665.  
  8666.  
  8667.  
  8668.  
  8669.  
  8670.  
  8671.  
  8672.  
  8673.  
  8674.  
  8675.  
  8676.  
  8677.  
  8678.  
  8679.  
  8680.  
  8681.  
  8682.  
  8683.  
  8684.  
  8685.  
  8686.           Chapter Five - JORF Functions                                 135
  8687.  
  8688.  
  8689.  
  8690.  
  8691.  
  8692.  
  8693.  
  8694.  
  8695.                                       Event:Add
  8696.  
  8697.  
  8698.           Function  Event:Add ( Class, Type, Level ) 
  8699.  
  8700.           Purpose   Add an Event Class.
  8701.  
  8702.           Returns   None.
  8703.  
  8704.           See Also  Event:Do, Event:Del.
  8705.  
  8706.           Notes     The Event system is a way of performing a method in
  8707.                     response to an event that occurs during normal
  8708.                     processing.  This is a way of saying "If such and such
  8709.                     happens while this program runs, then do this to take
  8710.                     care of it".
  8711.  
  8712.                     Three types of events set up in the JORF system are the
  8713.                     key, trace and error events.  Key events occur whenever
  8714.                     the operator enters a keystroke.  This allows the
  8715.                     system to evaluate the key and to respond
  8716.                     appropriately.  Trace events are used for trace mode
  8717.                     debugging, and will be executed at particular times
  8718.                     during while a method is begin interpreted.  Error
  8719.                     events occurs when is an error.  It is automatically
  8720.                     called, in hopes that error recovery is possible.  Of
  8721.                     these, Key events are by far the most common. 
  8722.  
  8723.                     Event:Add adds a new Class name to the event stack for
  8724.                     event Type tied to the current program Level.  The
  8725.                     event classes form a stack so that the new entry is
  8726.                     simply the top one of many that might be used.  The
  8727.                     level lets the system know what method is declaring the
  8728.                     new class, and will automatically clear this entry when
  8729.                     that method is completed.
  8730.  
  8731.                     The types Error and Key are already used by JORF for
  8732.                     error and keystroke handling.  Other types may be any
  8733.                     name later used by Event:Do.
  8734.  
  8735.                     When events are performed, the event stack is searched
  8736.                     from top (most recent) to bottom.  When a valid method
  8737.                     is found, it is executed.  If the method returns any
  8738.                     value, the search is completed.  If the method returns
  8739.                     null, the search is continued down the event stack.  A
  8740.                     null class can be used to block the search function
  8741.                     from going any lower on the event stack.
  8742.  
  8743.                     If this is not complicated enough, there is a "Hot"
  8744.                     event system.  If you declare an event with a Level of
  8745.                     zero, then you create a hot event.  Once declared, Hot
  8746.  
  8747.           The JORF Manual (Shareware Disk Version)                      136
  8748.  
  8749.  
  8750.  
  8751.  
  8752.  
  8753.  
  8754.  
  8755.                     events are permanent.  Normal events are cleared when
  8756.                     the method that declared them is ended.  Hot events are
  8757.                     checked after the first event level, but before the
  8758.                     "Else" clause is checked.  Hot events give a way to set
  8759.                     default key values, like Alt-X for exit in the
  8760.                     debugger. 
  8761.  
  8762.                     The Level value should always be Here.
  8763.  
  8764.  
  8765.  
  8766.  
  8767.  
  8768.  
  8769.  
  8770.  
  8771.  
  8772.  
  8773.  
  8774.  
  8775.  
  8776.  
  8777.  
  8778.  
  8779.  
  8780.  
  8781.  
  8782.  
  8783.  
  8784.  
  8785.  
  8786.  
  8787.  
  8788.  
  8789.  
  8790.  
  8791.  
  8792.  
  8793.  
  8794.  
  8795.  
  8796.  
  8797.  
  8798.  
  8799.  
  8800.  
  8801.  
  8802.  
  8803.  
  8804.  
  8805.  
  8806.  
  8807.  
  8808.           Chapter Five - JORF Functions                                 137
  8809.  
  8810.  
  8811.  
  8812.  
  8813.  
  8814.  
  8815.  
  8816.  
  8817.                                       Event:Del
  8818.  
  8819.  
  8820.           Function  Event:Del ( Type ) 
  8821.  
  8822.           Purpose   Deletes the last event Class for event function of
  8823.                     designated Type.
  8824.  
  8825.           Returns   None.
  8826.  
  8827.           See Also  Event:Add, Event:Do.
  8828.  
  8829.           Notes     This function is rarely used because usually the Event
  8830.                     Classes are deleted automatically when the method that
  8831.                     creates them is ended.  The sole use of this command is
  8832.                     to try to circumvent that system.  You should try to
  8833.                     work with the automatic delete system, because it is
  8834.                     more robust.  However, if you insist, this function
  8835.                     will delete the last event class entry with this Type.
  8836.  
  8837.  
  8838.  
  8839.  
  8840.  
  8841.  
  8842.  
  8843.  
  8844.  
  8845.  
  8846.  
  8847.  
  8848.  
  8849.  
  8850.  
  8851.  
  8852.  
  8853.  
  8854.  
  8855.  
  8856.  
  8857.  
  8858.  
  8859.  
  8860.  
  8861.  
  8862.  
  8863.  
  8864.  
  8865.  
  8866.  
  8867.  
  8868.  
  8869.           The JORF Manual (Shareware Disk Version)                      138
  8870.  
  8871.  
  8872.  
  8873.  
  8874.  
  8875.  
  8876.  
  8877.  
  8878.                                        Event:Do
  8879.  
  8880.  
  8881.           Function  Event:Do ( Method, Type ) 
  8882.  
  8883.           Purpose   Performs an event.  
  8884.  
  8885.           Returns   If an event method is found, executed and returns a
  8886.                     value, then that value is returned by Event:Do.
  8887.  
  8888.           See Also  Event:Add, Event:Del.
  8889.  
  8890.           Notes     The most confusing thing here is to figure out how the
  8891.                     system is creating the method name to call when an
  8892.                     event is performed.  The inclination is to look at this
  8893.                     command and assume that the method will perform
  8894.                     Type:Method.  Instead, the type is used to down the
  8895.                     event stack for the appropriate Class that was set
  8896.                     using Event:Add.  It is this class used to do
  8897.                     Class:Method.
  8898.  
  8899.                     Each class of the correct type is attempted.  If that
  8900.                     fails, then the system looks for an Else method for
  8901.                     that class.  The Else methods are a default method for
  8902.                     the event type.  If this is not found, the system looks
  8903.                     down the event stack to the next lower class of the
  8904.                     correct Type.
  8905.  
  8906.                     This system allows a layering of event actions.  It was
  8907.                     designed primarily for keystroke handling, where a
  8908.                     certain screen may need to reassign only four keys,
  8909.                     while maintaining the functions of other keys.  Many
  8910.                     key handling systems remap all keys.  This is unwieldy
  8911.                     if only four keys have different definition.  But, for
  8912.                     events other than keystrokes, this overlay ability may
  8913.                     be too complicated and unnecessary.  Liberal use of the
  8914.                     Else method is recommended to avoid the stack search
  8915.                     and resulting confusion.
  8916.  
  8917.                              Special Notes for Key Events
  8918.  
  8919.                     For text entry, data entry and menu selection,
  8920.                     keystrokes from the operator are translated by the
  8921.                     system using the KeyClass stack.  The names in the
  8922.                     stack interpret the current keystroke.  The keystroke
  8923.                     is converted to a string value and the method called
  8924.                     that corresponds to the appropriate class and value. 
  8925.                     For instance, pressing the Escape key with a KeyClass
  8926.                     of "MenuKey" will invoke the method MenuKey:Escape_Key.
  8927.  
  8928.  
  8929.  
  8930.           Chapter Five - JORF Functions                                 139
  8931.  
  8932.  
  8933.  
  8934.  
  8935.  
  8936.  
  8937.  
  8938.                     Normal letters have "_Key" appended, so hitting B will
  8939.                     return "B_Key".  Alternate and Control keys have a
  8940.                     prefix appended to create "Alt_B_Key" and "Ctrl_B_Key". 
  8941.                     Special keys return special values like "Home_Key",
  8942.                     "F1_Key" and "Ctrl_Right_Arrow_Key".  A list of special
  8943.                     key values is in Appendix B.
  8944.  
  8945.                             Special notes for Error Events
  8946.  
  8947.                     Error events are called like the key events using the
  8948.                     error number as the method name.  Inside an error event
  8949.                     several values are set using Mem:Ptr:
  8950.  
  8951.                     Mem:Ptr->ErrNum     | JORF Error Number
  8952.                     Mem:Ptr->ErrDOS     | Last DOS error number
  8953.                     Mem:Ptr->ErrLine    | Line that was executing when 
  8954.                                         |   error occurred
  8955.                     Mem:Ptr->ErrMsg     | Text of the error message
  8956.  
  8957.                     Fatal errors do not call the event system.  Usually
  8958.                     these errors show that something has happened that will
  8959.                     not allow further action in The JORF Language
  8960.                     interpreter, and the program must halt immediately
  8961.                     before data integrity can be lost.
  8962.  
  8963.                     When an error occurs while processing another error,
  8964.                     the second error is considered fatal.
  8965.  
  8966.  
  8967.  
  8968.  
  8969.  
  8970.  
  8971.  
  8972.  
  8973.  
  8974.  
  8975.  
  8976.  
  8977.  
  8978.  
  8979.  
  8980.  
  8981.  
  8982.  
  8983.  
  8984.  
  8985.  
  8986.  
  8987.  
  8988.  
  8989.  
  8990.  
  8991.           The JORF Manual (Shareware Disk Version)                      140
  8992.  
  8993.  
  8994.  
  8995.  
  8996.  
  8997.  
  8998.  
  8999.  
  9000.                                         False
  9001.  
  9002.  
  9003.           Function  False
  9004.  
  9005.           Purpose   Used to test for Logical False.
  9006.  
  9007.           Returns   Null.  
  9008.  
  9009.           See Also  True.
  9010.  
  9011.           Notes     Most programming language express results of logical
  9012.                     equations as zero to indicate False, and one to
  9013.                     indicate True.  These values are called Boolean values. 
  9014.  
  9015.  
  9016.                     This function was created in the interest of program
  9017.                     clarity.  It simply returns Null.  Due to the automatic
  9018.                     type conversions inherent to Jorf Pointers, this is
  9019.                     exactly the same as the integer zero.
  9020.  
  9021.  
  9022.  
  9023.  
  9024.  
  9025.  
  9026.  
  9027.  
  9028.  
  9029.  
  9030.  
  9031.  
  9032.  
  9033.  
  9034.  
  9035.  
  9036.  
  9037.  
  9038.  
  9039.  
  9040.  
  9041.  
  9042.  
  9043.  
  9044.  
  9045.  
  9046.  
  9047.  
  9048.  
  9049.  
  9050.  
  9051.  
  9052.           Chapter Five - JORF Functions                                 141
  9053.  
  9054.  
  9055.  
  9056.  
  9057.  
  9058.  
  9059.  
  9060.  
  9061.                                      File:Append
  9062.  
  9063.  
  9064.           Function  File:Append ( FileName, Line )  
  9065.  
  9066.           Purpose   Append Line to the end of  FileName..
  9067.  
  9068.           Returns   Record Number.
  9069.  
  9070.           See Also  File:Write.
  9071.  
  9072.           Notes     Append a line to a text file, or a record to a
  9073.                     formatted file.
  9074.  
  9075.                     If you append to a mapped file, this function appends
  9076.                     line or if null, appends a blank record to the end of
  9077.                     the file.  The function returns the new record number. 
  9078.  
  9079.  
  9080.                     If you append to an unmapped file, a text line is added
  9081.                     followed by a Carriage Return-Line Feed (CR-LF) pair. 
  9082.                     If Line is null, just the CR-LF is written to file. 
  9083.                     The return value is the byte position of the new line
  9084.                     in the file.
  9085.  
  9086.                     When used with DLM, SDF and FIXED mapping formats, this
  9087.                     function allows you to append records as desired to the
  9088.                     file.  You need not specify Line.  WIthout it, the
  9089.                     effect is exactly like the dBASE "APPEND BLANK"
  9090.                     command. This function is specifically written to make
  9091.                     dBASE language programmers comfortable.
  9092.  
  9093.  
  9094.  
  9095.  
  9096.  
  9097.  
  9098.  
  9099.  
  9100.  
  9101.  
  9102.  
  9103.  
  9104.  
  9105.  
  9106.  
  9107.  
  9108.  
  9109.  
  9110.  
  9111.  
  9112.  
  9113.           The JORF Manual (Shareware Disk Version)                      142
  9114.  
  9115.  
  9116.  
  9117.  
  9118.  
  9119.  
  9120.  
  9121.  
  9122.                                      File:Backup
  9123.  
  9124.  
  9125.           Function  File:Backup ( FileName )  
  9126.  
  9127.           Purpose   Renames FileName to have an extension of .BAK.
  9128.  
  9129.           Returns   None.
  9130.  
  9131.           See Also  Other File functions.
  9132.  
  9133.           Notes     This function makes a backup of a file, presumably
  9134.                     before calling a command that might overwrite the file
  9135.                     like File:Save. 
  9136.  
  9137.           Example   See Arr:Pick.
  9138.  
  9139.  
  9140.  
  9141.  
  9142.  
  9143.  
  9144.  
  9145.  
  9146.  
  9147.  
  9148.  
  9149.  
  9150.  
  9151.  
  9152.  
  9153.  
  9154.  
  9155.  
  9156.  
  9157.  
  9158.  
  9159.  
  9160.  
  9161.  
  9162.  
  9163.  
  9164.  
  9165.  
  9166.  
  9167.  
  9168.  
  9169.  
  9170.  
  9171.  
  9172.  
  9173.  
  9174.           Chapter Five - JORF Functions                                 143
  9175.  
  9176.  
  9177.  
  9178.  
  9179.  
  9180.  
  9181.  
  9182.  
  9183.                                       File:ChDir
  9184.  
  9185.  
  9186.           Function  File:ChDir ( NewDir )  
  9187.  
  9188.           Purpose   Change current directory or Return current directory.
  9189.  
  9190.           Returns   If NewDir is Null, returns current Directory.  If
  9191.                     present, returns Ok if successful, False if not. 
  9192.  
  9193.           See Also  Other File functions.
  9194.  
  9195.           Notes     This function is the equivalent of the DOS ChDir or CD
  9196.                     command.  Like ChDir, it can be used two ways.  By
  9197.                     itself, it simply returns the disk and path of the
  9198.                     current working directory.  If followed by a new path,
  9199.                     it changes to that path.
  9200.  
  9201.                     Unlike DOS ChDir, File:ChDir will change drives as well
  9202.                     as paths.  If you say CD D:\ while logged to drive C:
  9203.                     in DOS, you only change the default directory on D:.. 
  9204.                     If you say File:ChDir("D:\") in the JORF language, you
  9205.                     will be moved to drive D:, root directory.. 
  9206.  
  9207.  
  9208.  
  9209.  
  9210.  
  9211.  
  9212.  
  9213.  
  9214.  
  9215.  
  9216.  
  9217.  
  9218.  
  9219.  
  9220.  
  9221.  
  9222.  
  9223.  
  9224.  
  9225.  
  9226.  
  9227.  
  9228.  
  9229.  
  9230.  
  9231.  
  9232.  
  9233.  
  9234.  
  9235.           The JORF Manual (Shareware Disk Version)                      144
  9236.  
  9237.  
  9238.  
  9239.  
  9240.  
  9241.  
  9242.  
  9243.  
  9244.                                       File:Close
  9245.  
  9246.  
  9247.           Function  File:Close ( FileName )  
  9248.  
  9249.           Purpose   Explicit close for  FileName..
  9250.  
  9251.           Returns   None.
  9252.  
  9253.           See Also  Other File functions.
  9254.  
  9255.           Notes     You do not have to close files in the JORF language. An
  9256.                     unmapped file is closed automatically when the method
  9257.                     that uses that file is ended.  A Mapped file is closed
  9258.                     according to the Level specified in the mapping.  Files
  9259.                     that are renamed or deleted are automatically closed
  9260.                     prior to the renaming.
  9261.  
  9262.                     This function exists only for the rare exception where
  9263.                     an explicit close is desired for the purposes of other
  9264.                     operations in the current routine.
  9265.  
  9266.  
  9267.  
  9268.  
  9269.  
  9270.  
  9271.  
  9272.  
  9273.  
  9274.  
  9275.  
  9276.  
  9277.  
  9278.  
  9279.  
  9280.  
  9281.  
  9282.  
  9283.  
  9284.  
  9285.  
  9286.  
  9287.  
  9288.  
  9289.  
  9290.  
  9291.  
  9292.  
  9293.  
  9294.  
  9295.  
  9296.           Chapter Five - JORF Functions                                 145
  9297.  
  9298.  
  9299.  
  9300.  
  9301.  
  9302.  
  9303.  
  9304.  
  9305.                                       File:Copy
  9306.  
  9307.  
  9308.           Function  File:Copy ( OldName, NewName )  
  9309.  
  9310.           Purpose   Copies file from OldName to NewName.
  9311.  
  9312.           Returns   Ok if copied, Null if file not found or unable to
  9313.                     copy..
  9314.  
  9315.           See Also  Other File functions.
  9316.  
  9317.           Notes     This function copies a file.  Like DOS, this function
  9318.                     will erase the an existing files in order to re-use the
  9319.                     name.  
  9320.  
  9321.  
  9322.  
  9323.  
  9324.  
  9325.  
  9326.  
  9327.  
  9328.  
  9329.  
  9330.  
  9331.  
  9332.  
  9333.  
  9334.  
  9335.  
  9336.  
  9337.  
  9338.  
  9339.  
  9340.  
  9341.  
  9342.  
  9343.  
  9344.  
  9345.  
  9346.  
  9347.  
  9348.  
  9349.  
  9350.  
  9351.  
  9352.  
  9353.  
  9354.  
  9355.  
  9356.  
  9357.           The JORF Manual (Shareware Disk Version)                      146
  9358.  
  9359.  
  9360.  
  9361.  
  9362.  
  9363.  
  9364.  
  9365.  
  9366.                                        File:Del
  9367.  
  9368.  
  9369.           Function  File:Del ( Name )  
  9370.  
  9371.           Purpose   Delete a file from disk.
  9372.  
  9373.           Returns   Ok if file is deleted, Null if not.
  9374.  
  9375.           See Also  Other File functions.
  9376.  
  9377.           Notes     All information in the file will be destroyed.  If the
  9378.                     file is currently opened, it will be closed.  Does not
  9379.                     give an error if the file is absent. 
  9380.  
  9381.  
  9382.  
  9383.  
  9384.  
  9385.  
  9386.  
  9387.  
  9388.  
  9389.  
  9390.  
  9391.  
  9392.  
  9393.  
  9394.  
  9395.  
  9396.  
  9397.  
  9398.  
  9399.  
  9400.  
  9401.  
  9402.  
  9403.  
  9404.  
  9405.  
  9406.  
  9407.  
  9408.  
  9409.  
  9410.  
  9411.  
  9412.  
  9413.  
  9414.  
  9415.  
  9416.  
  9417.  
  9418.           Chapter Five - JORF Functions                                 147
  9419.  
  9420.  
  9421.  
  9422.  
  9423.  
  9424.  
  9425.  
  9426.  
  9427.                                       File:Exist
  9428.  
  9429.  
  9430.           Function  File:Exist ( FileName Command )  
  9431.  
  9432.           Purpose   Checks file existence, read permission or write
  9433.                     permission. 
  9434.  
  9435.           Returns   True if file exists, can be read, or can be opened for
  9436.                     writing.  Returns False if not.
  9437.  
  9438.           See Also  Other File functions.
  9439.  
  9440.           Notes     This function is the JORF language equivalent to the
  9441.                     UNIX C language access() function.  Command may be Null
  9442.                     or "Exist" to check for existence.
  9443.  
  9444.                     If Command is null or absent, the existence of the file
  9445.                     is checked.  If the file exists, this function returns
  9446.                     True.  If the file does not exist, the function returns
  9447.                     False.
  9448.  
  9449.                     Command may be "Read" to check for network read access
  9450.                     to the file.  If the file exists and can be read, this
  9451.                     function returns True.  If the file does not exist, or
  9452.                     cannot be opened by the current operator for reading,
  9453.                     the function returns False.
  9454.  
  9455.                     Command may be  "Write" to check for network write
  9456.                     access to the file.  If the file exists and can be
  9457.                     opened for writing by the current operator, the
  9458.                     function returns True.  If the file does not exist, or
  9459.                     cannot be opened for writing, the function returns
  9460.                     False.
  9461.  
  9462.                     This function used to be named File:Access.  The name
  9463.                     was changed in version 2.1 of the JORF Interpreter. 
  9464.                     The name was changed to be more indicative of the most
  9465.                     common use of this function.
  9466.  
  9467.           Example   See Event:Add.
  9468.  
  9469.  
  9470.  
  9471.  
  9472.  
  9473.  
  9474.  
  9475.  
  9476.  
  9477.  
  9478.  
  9479.           The JORF Manual (Shareware Disk Version)                      148
  9480.  
  9481.  
  9482.  
  9483.  
  9484.  
  9485.  
  9486.  
  9487.  
  9488.                                        File:Len
  9489.  
  9490.  
  9491.           Function  File:Len ( Name ) 
  9492.  
  9493.           Purpose   Get Length of file on disk.
  9494.  
  9495.           Returns   Length of file in Bytes.
  9496.  
  9497.           See Also  Other File functions.
  9498.  
  9499.           Notes     Returns the current length of the file in bytes.  If
  9500.                     the file is not found, the length will be 0, the same
  9501.                     as if the file is empty.
  9502.  
  9503.           Example   See File:Read
  9504.  
  9505.  
  9506.  
  9507.  
  9508.  
  9509.  
  9510.  
  9511.  
  9512.  
  9513.  
  9514.  
  9515.  
  9516.  
  9517.  
  9518.  
  9519.  
  9520.  
  9521.  
  9522.  
  9523.  
  9524.  
  9525.  
  9526.  
  9527.  
  9528.  
  9529.  
  9530.  
  9531.  
  9532.  
  9533.  
  9534.  
  9535.  
  9536.  
  9537.  
  9538.  
  9539.  
  9540.           Chapter Five - JORF Functions                                 149
  9541.  
  9542.  
  9543.  
  9544.  
  9545.  
  9546.  
  9547.  
  9548.  
  9549.                                       File:Load
  9550.  
  9551.  
  9552.           Function  File:Load ( Name )  
  9553.  
  9554.           Purpose   Load a text file into a text pointer.
  9555.  
  9556.           Returns   Text pointer.
  9557.  
  9558.           See Also  File:Save, File:Read.
  9559.  
  9560.           Notes     Loads a text file wholesale into swap storage, which is
  9561.                     much faster than trying to read it line-by-line and
  9562.                     adding the lines using Text:Add.  Use this for text
  9563.                     file editors like the JORF.INI editor.
  9564.  
  9565.           Example   See Event:Add.
  9566.  
  9567.  
  9568.  
  9569.  
  9570.  
  9571.  
  9572.  
  9573.  
  9574.  
  9575.  
  9576.  
  9577.  
  9578.  
  9579.  
  9580.  
  9581.  
  9582.  
  9583.  
  9584.  
  9585.  
  9586.  
  9587.  
  9588.  
  9589.  
  9590.  
  9591.  
  9592.  
  9593.  
  9594.  
  9595.  
  9596.  
  9597.  
  9598.  
  9599.  
  9600.  
  9601.           The JORF Manual (Shareware Disk Version)                      150
  9602.  
  9603.  
  9604.  
  9605.  
  9606.  
  9607.  
  9608.  
  9609.  
  9610.                                        File:Map
  9611.  
  9612.  
  9613.           Function  File:Map ( Name, Level, Type, Class, Map ) 
  9614.  
  9615.           Purpose   Map a file in a foreign format for reading and writing.
  9616.  
  9617.           Returns   None.
  9618.  
  9619.           See Also  File:Read, File:Write.
  9620.  
  9621.           Notes     Map a file for use with File:Read and File:Write.  When
  9622.                     you map a file you map structures and fields to write
  9623.                     different file types.
  9624.  
  9625.                     The parameter name is sets the file name.  Once mapped,
  9626.                     all reads and writes to that file will be influenced by
  9627.                     the mapping.
  9628.  
  9629.                     The parameter type sets the type of the file to be
  9630.                     mapped.  Available types are DLM, SDF, FIXED, and
  9631.                     DBASE.
  9632.  
  9633.                     DLM stands for comma delimited.  This is the most
  9634.                     common type.  Fields are quoted and separated by
  9635.                     commas.  There is a fixed number of fields per records. 
  9636.                     Records end in a carriage return line feed pair.
  9637.  
  9638.                     FIXED stands for fixed length record format.  This is
  9639.                     the most common proprietary format.
  9640.  
  9641.                     SDF stands for system data format.  This type is very
  9642.                     close to FIXED but records in an SDF file must end in a
  9643.                     carriage return-line feed pair.
  9644.  
  9645.                     DBASE stands for DBASE III format files.  Normally you
  9646.                     use the special DB:Map function to map dBASE files. 
  9647.                     This function automatically calls DB:Map if you want to
  9648.                     use this function for consistency. .
  9649.  
  9650.                     The last parameter is usually an indented section that
  9651.                     contains the field mapping.  Each line of this section
  9652.                     relates to a single field in the mapping.  You must map
  9653.                     every field, even if you don't want the data.  You can
  9654.                     map several fields into one so if you create a field
  9655.                     that is called "junk" and put all extra fields into it
  9656.                     you will fulfil the mapping requirement.
  9657.  
  9658.  
  9659.  
  9660.  
  9661.  
  9662.           Chapter Five - JORF Functions                                 151
  9663.  
  9664.  
  9665.  
  9666.  
  9667.  
  9668.  
  9669.  
  9670.  
  9671.                     The simplest mapping is for a delimited file, where you
  9672.                     merely have to list the field names.
  9673.  
  9674.  
  9675.           Contact:CvtDlm
  9676.                       New (Contact:Contact,FName,Counter)
  9677.                       FName="MyFile.Dat"
  9678.  
  9679.                       | Add a window to show what is happening
  9680.                       Win:Add ("Reading {FName}", 0, 0, 10, 76, Here)
  9681.                       File:Map (Fname,Here,"DLM","Contact")
  9682.                         Company
  9683.                         Addr1
  9684.                         Addr2
  9685.                         Addr3
  9686.                         Junk
  9687.                         FullName
  9688.                         Zip
  9689.                         Junk
  9690.                       While (File:Ok(Fname))
  9691.                         Contact=File:Read(Fname,Here)
  9692.                         ++Counter
  9693.                         If (Contact->FullName==Null)
  9694.                           Contact->FullName = Contact->Company
  9695.                         | Put record stuff in window to show what is happening
  9696.                         Str:Put (Str:Pad(Counter,4))
  9697.                         Str:Put (Str:Pad(Contact->Company,30))
  9698.                         Str:Put (Str:Pad(Contact->FullName,30))
  9699.                         Str:PutLine
  9700.                         Jorf:Write(Contact)
  9701.                       Return Ok
  9702.  
  9703.  
  9704.  
  9705.  
  9706.  
  9707.  
  9708.  
  9709.  
  9710.  
  9711.  
  9712.  
  9713.  
  9714.  
  9715.  
  9716.  
  9717.  
  9718.  
  9719.  
  9720.  
  9721.  
  9722.  
  9723.           The JORF Manual (Shareware Disk Version)                      152
  9724.  
  9725.  
  9726.  
  9727.  
  9728.  
  9729.  
  9730.  
  9731.  
  9732.                     The next simplest is for a FIXED or SDF file.  These
  9733.                     formats are very similar because they are both fixed
  9734.                     length format.  The only difference is that you must
  9735.                     include the record length when you read a FIXED length
  9736.                     file.  You don't need a record length when you read a
  9737.                     DLM file.  In a FIXED length file, if you map wrong,
  9738.                     your fields will be split.  If you really map wrong,
  9739.                     excess fields are ignored and not enough fields will
  9740.                     result in blank fields in the JORF structure.
  9741.  
  9742.                     In a fixed length format, you must specify the length
  9743.                     of each field.
  9744.  
  9745.                     Contact:CvtFIXED
  9746.                       New (Contact:Contact,FName,Counter)
  9747.                       FName="MyFile.Dat"
  9748.                       | Add a window to show what is happening
  9749.                       Win:Add ("Reading {FName}", 0, 0, 10, 76, Here)
  9750.                       File:Map (Fname,Here,"FIXED","Contact")
  9751.                         Company   Len:40
  9752.                         Addr1     Len:40
  9753.                         Addr2     Len:40
  9754.                         Addr3     Len:40
  9755.                         Junk      Len:20
  9756.                         FullName  Len:40
  9757.                         Zip       Len:10
  9758.                         Junk      Len:2
  9759.                       While (File:Ok(Fname))
  9760.                         Contact=File:Read(Fname,Here,232)  | Record length is 232
  9761.                         ++Counter
  9762.                         If (Contact->FullName==Null)
  9763.                           Contact->FullName = Contact->Company
  9764.                         | Put record stuff in window to show what is happening
  9765.                         Str:Put (Str:Pad(Counter,4))
  9766.                         Str:Put (Str:Pad(Contact->Company,30))
  9767.                         Str:Put (Str:Pad(Contact->FullName,30))
  9768.                         Str:PutLine
  9769.                         Jorf:Write(Contact)
  9770.                       Return Ok
  9771.  
  9772.  
  9773.                     The last format is for dBase files, and is handled in
  9774.                     detail in the reference section for DB:Map.  If you are
  9775.                     want to use the dBASE field names, you hardly need map
  9776.                     the file at all.  If you want to write NTX indexes, you
  9777.                     will have to declare them in the mapping section
  9778.                     however.  If you are creating a new file, or want to
  9779.                     change the field names in the file, you must map each
  9780.                     field.
  9781.  
  9782.  
  9783.  
  9784.           Chapter Five - JORF Functions                                 153
  9785.  
  9786.  
  9787.  
  9788.  
  9789.  
  9790.  
  9791.  
  9792.                     dBASE files carry their mapping in the file header.  If
  9793.                     your map does not match the actual file map, then not
  9794.                     all of your fields will have a proper value.  Your
  9795.                     fields may not come into effect until you create or
  9796.                     rebuild the file according to your specified data base
  9797.                     fields.
  9798.  
  9799.                     It is generally best to define the Len, dName (the name
  9800.                     of the field in the dBase file).  You can also define
  9801.                     the Dec for decimal point, and dtype for the dBase
  9802.                     field type.  If you do not define these the decimal
  9803.                     places will default to zero, and the dType will default
  9804.                     to 'C' for the dBase Character type.
  9805.  
  9806.                     Contact:CvtDBASE
  9807.                       New (Contact:Contact,FName,Counter)
  9808.                       FName="MyFile.Dat"
  9809.                       | Add a window to show what is happening
  9810.                       Win:Add ("Reading {FName}", 0, 0, 10, 76, Here)
  9811.                       File:Map (Fname,Here,"DBASE","Contact")
  9812.                         Company   Len:40 dName:COMPANY
  9813.                         Addr1     Len:40 dName:ADDR1
  9814.                         Addr2     Len:40 dName:ADDR2
  9815.                         Addr3     Len:40 dName:CITSTZ
  9816.                         Junk      Len:20 dName:CODES
  9817.                         FullName  Len:40 dName:CONTACT
  9818.                         Zip       Len:10 dName:ZIP
  9819.                       While (File:Ok(Fname))
  9820.                         Contact=File:Read(Fname,Here)  | No record length needed
  9821.                         ++Counter
  9822.                         If (Contact->FullName==Null)
  9823.                           Contact->FullName = Contact->Company
  9824.                         | Put record stuff in window to show what is happening
  9825.                         Str:Put (Str:Pad(Counter,4))
  9826.                         Str:Put (Str:Pad(Contact->Company,30))
  9827.                         Str:Put (Str:Pad(Contact->FullName,30))
  9828.                         Str:PutLine
  9829.                         Jorf:Write(Contact)
  9830.                       Return Ok
  9831.  
  9832.  
  9833.  
  9834.  
  9835.  
  9836.  
  9837.  
  9838.  
  9839.  
  9840.  
  9841.  
  9842.  
  9843.  
  9844.  
  9845.           The JORF Manual (Shareware Disk Version)                      154
  9846.  
  9847.  
  9848.  
  9849.  
  9850.  
  9851.  
  9852.  
  9853.  
  9854.                                      File:MoveTo
  9855.  
  9856.  
  9857.           Function  File:MoveTo ( Name, Position ) 
  9858.  
  9859.           Purpose   Go to the front or back of a file.
  9860.  
  9861.           Returns   None.
  9862.  
  9863.           See Also  File:Read.
  9864.  
  9865.           Notes     Can be used to "Rewind" a file to the beginning, or to
  9866.                     "Append" after rewinding.  Position must be the string
  9867.                     value "Beginning" or "End".  Only the first letter is
  9868.                     used, but three letters ("Beg" and "End") are
  9869.                     recommended for clarity.
  9870.  
  9871.  
  9872.  
  9873.  
  9874.  
  9875.  
  9876.  
  9877.  
  9878.  
  9879.  
  9880.  
  9881.  
  9882.  
  9883.  
  9884.  
  9885.  
  9886.  
  9887.  
  9888.  
  9889.  
  9890.  
  9891.  
  9892.  
  9893.  
  9894.  
  9895.  
  9896.  
  9897.  
  9898.  
  9899.  
  9900.  
  9901.  
  9902.  
  9903.  
  9904.  
  9905.  
  9906.           Chapter Five - JORF Functions                                 155
  9907.  
  9908.  
  9909.  
  9910.  
  9911.  
  9912.  
  9913.  
  9914.  
  9915.                                        File:Ok
  9916.  
  9917.  
  9918.           Function  File:Ok 
  9919.  
  9920.           Purpose   Check for End of File while reading.
  9921.  
  9922.           Returns   False if End of File has been reached while reading,
  9923.                     otherwise True. 
  9924.  
  9925.           See Also  File:Read, File:Len.
  9926.  
  9927.           Notes     This command is used in conjunction with File:Read to
  9928.                     create a loop that ends when the last line or record of
  9929.                     the file has been read.  This test is the opposite of
  9930.                     the normal C function eof(), because I like testing "If
  9931.                     Ok" rather than "If Not EOF".
  9932.  
  9933.                     If a file is not yet open, it is still "Ok". This fact
  9934.                     enables you to make cleaner While loops.
  9935.  
  9936.           Example   See File:Map.
  9937.  
  9938.  
  9939.  
  9940.  
  9941.  
  9942.  
  9943.  
  9944.  
  9945.  
  9946.  
  9947.  
  9948.  
  9949.  
  9950.  
  9951.  
  9952.  
  9953.  
  9954.  
  9955.  
  9956.  
  9957.  
  9958.  
  9959.  
  9960.  
  9961.  
  9962.  
  9963.  
  9964.  
  9965.  
  9966.  
  9967.           The JORF Manual (Shareware Disk Version)                      156
  9968.  
  9969.  
  9970.  
  9971.  
  9972.  
  9973.  
  9974.  
  9975.  
  9976.                                       File:Print
  9977.  
  9978.  
  9979.           Function  File:Print ( File Printer Flags ) 
  9980.  
  9981.           Purpose   Print a File on a printer.
  9982.  
  9983.           Returns   None.
  9984.  
  9985.           See Also  Arr:Printers
  9986.  
  9987.           Notes     Printer output is always a chore, and never gets any
  9988.                     easier.  Even after IBM creates the great parallel
  9989.                     interface, that is standard and needs no set up,
  9990.                     companies like Hewlett Packard create printers like the
  9991.                     original Laserjet that only support serial output.
  9992.  
  9993.                     The adjustment to MS-Windows has caused the Str:Print
  9994.                     and Char:Print commands to be eliminated, and this
  9995.                     command put in their place.   Windows support for
  9996.                     character-by-character output to printers was just too
  9997.                     slow to be tolerable.  MS-DOS programmers may also note
  9998.                     that Windows requires that printing under Windows is
  9999.                     done by page, and that only full pages may be printed. 
  10000.  
  10001.                     This command prints File to the designated printer. 
  10002.                     The printer is usually the output from the Jorf:Printer
  10003.                     function.  The file can also be SCREEN, FILE, PRN, AUX,
  10004.                     LPT1, LPT2, COM1, or COM2  indicate screen, print to
  10005.                     file, default printer, auxiliary, line printer one and
  10006.                     two and serial printer one and two respectively.  The
  10007.                     different printing mechanisms are distinct.
  10008.  
  10009.                     The of the printer options, the easiest and most robust
  10010.                     is to print to PRN, the default printer.  To test to
  10011.                     see if your printer is working, use the DOS PRINT
  10012.                     command to print a small file.  If it prints normally,
  10013.                     you should have no problems using Str:Print "PRN"
  10014.                     String.  DOS lets you redirect PRN to any printer,
  10015.                     including serial printers.
  10016.  
  10017.                     The next most robust is LPT1 and LPT2.  These use a
  10018.                     different BIOS call than PRN so they may not work even
  10019.                     when PRN works just fine.  These commands send output
  10020.                     to parallel printers.  Parallel printers may be
  10021.                     identified by having a thick cable and a
  10022.                     bigger-than-normal connector on the printer end of the
  10023.                     cable.  
  10024.  
  10025.                     The most difficult type of printer to use is the serial
  10026.                     printer.  Serial ports COM1 and COM2 are general
  10027.  
  10028.           Chapter Five - JORF Functions                                 157
  10029.  
  10030.  
  10031.  
  10032.  
  10033.  
  10034.  
  10035.  
  10036.                     communications ports, and the RS232 standard is not as
  10037.                     standard as I would like.  As always, try to get your
  10038.                     printer to work using the DOS Print command, and not
  10039.                     with the JORF interpreter.  If you cannot print from
  10040.                     DOS, I guarantee that you will not print from JORF.
  10041.  
  10042.                     You cannot set the speed of the port in the JORF
  10043.                     interpreter.  Instead, use the DOS MODE command.  Most
  10044.                     printers default to 9600 baud, 8 bits, no parity, one
  10045.                     stop bit, that can be set with the following command:
  10046.  
  10047.                                    C>Mode Com1:9600,n,8,1,p
  10048.  
  10049.                     If this works, put it in your AUTOEXEC.BAT file so it
  10050.                     sets the port up every time the computer starts.  If
  10051.                     this doesn't work, check your printer manual to see
  10052.                     that the printer and the serial port mode agree.
  10053.  
  10054.                     In theory, the File:Print supports COM1 to COM9 and
  10055.                     LPT1 to LPT9.  However, DOS and Windows your BIOS
  10056.                     probably don't.  Windows is especially notorious for
  10057.                     not handling COM3 and COM4 correctly, even when they
  10058.                     work under DOS.
  10059.  
  10060.                     JORF does not yet support any printer control codes,
  10061.                     even under windows.  Your file will be printed using
  10062.                     the default font on your printer.  Page breaks are
  10063.                     respected, and even if your document does not end with
  10064.                     a page break, a formfeed will be added.
  10065.  
  10066.                     The Flags parameter is usually omitted.  The only valid
  10067.                     flag value is "N" for No-Eject  last page.  Normally
  10068.                     the last page of the report is ejected, but this may
  10069.                     not be desired for when printing mailing labels or
  10070.                     other continuous forms.  Other flags are anticipated.
  10071.  
  10072.  
  10073.  
  10074.  
  10075.  
  10076.  
  10077.  
  10078.  
  10079.  
  10080.  
  10081.  
  10082.  
  10083.  
  10084.  
  10085.  
  10086.  
  10087.  
  10088.  
  10089.           The JORF Manual (Shareware Disk Version)                      158
  10090.  
  10091.  
  10092.  
  10093.  
  10094.  
  10095.  
  10096.  
  10097.  
  10098.           Example   This fragment is from Contact.J.
  10099.  
  10100.           Contact:MergeLetter
  10101.             New (Dest,Letter,CurrContact)
  10102.             Time:Get(Mem:Ptr)
  10103.  
  10104.             Letter=File:Load(Contact:GetLetter)
  10105.             If (Letter!=Null)
  10106.               Dest=Jorf:Printer()
  10107.               If (Dest)
  10108.                 CurrContact=Mem:Ptr->Contact
  10109.                 Mem:Ptr->Contact=Null
  10110.                 Win:Add("Printing")
  10111.                   Printing . . .
  10112.                 Rep:Add ("Merge Letter", 5, 5, 60, 75,Here)
  10113.                   Header:"" Row:1
  10114.                   Next:"Contact:NextRecord('Next')"
  10115.                   Text:"Letter"
  10116.                 File:Print("JREPORT.LST",Dest)
  10117.                 Mem:Ptr->Contact=CurrContact
  10118.             Return (Ok)
  10119.  
  10120.  
  10121.  
  10122.  
  10123.  
  10124.  
  10125.  
  10126.  
  10127.  
  10128.  
  10129.  
  10130.  
  10131.  
  10132.  
  10133.  
  10134.  
  10135.  
  10136.  
  10137.  
  10138.  
  10139.  
  10140.  
  10141.  
  10142.  
  10143.  
  10144.  
  10145.  
  10146.  
  10147.  
  10148.  
  10149.  
  10150.           Chapter Five - JORF Functions                                 159
  10151.  
  10152.  
  10153.  
  10154.  
  10155.  
  10156.  
  10157.  
  10158.  
  10159.                                       File:Read
  10160.  
  10161.  
  10162.           Function  File:Read ( Name, Size, Offset ) 
  10163.  
  10164.           Purpose   Read a line of text or a record from a disk file.
  10165.  
  10166.           Returns   The line or record that was read.
  10167.  
  10168.           See Also  Other File Functions.
  10169.  
  10170.           Notes     The File:Read and File:Write commands handle both ASCII
  10171.                     and binary files without making any distinction between
  10172.                     them.  Name is required.  Normally this command reads
  10173.                     the next line of input terminated by the line feed
  10174.                     character.  The line feed character is eliminated from
  10175.                     the input text.
  10176.  
  10177.                     (In prior versions there was a parameter Level that is
  10178.                     now no longer used.  This change is not upward
  10179.                     compatible and you must be sure that any programs for
  10180.                     JORF versions prior to 2.1 are corrected.)
  10181.  
  10182.                     If Size is specified then the a binary file read will
  10183.                     take place where the record is Size bytes.  Offset is
  10184.                     specified then read will take place at that position
  10185.                     offset.  If not specified, the current file position
  10186.                     will be used.
  10187.  
  10188.                     You can return to the beginning of the file using
  10189.                     File:MoveTo and can go to a byte position using
  10190.                     File:Read with a record size of 1.
  10191.  
  10192.                     Reading a file in comma delimited, fixed length and
  10193.                     dBase format may be influenced by using the File:Map
  10194.                     function. 
  10195.  
  10196.           Example   See Arr:Sort
  10197.  
  10198.  
  10199.  
  10200.  
  10201.  
  10202.  
  10203.  
  10204.  
  10205.  
  10206.  
  10207.  
  10208.  
  10209.  
  10210.  
  10211.           The JORF Manual (Shareware Disk Version)                      160
  10212.  
  10213.  
  10214.  
  10215.  
  10216.  
  10217.  
  10218.  
  10219.  
  10220.                                      File:Rename
  10221.  
  10222.  
  10223.           Function  File:Rename ( OldName, NewName )  
  10224.  
  10225.           Purpose   Renames OldName to NewName.
  10226.  
  10227.           Returns   Ok if renamed, Null if file not found or unable to
  10228.                     rename..
  10229.  
  10230.           See Also  Other File functions.
  10231.  
  10232.           Notes     This function renames a file.  Unlike DOS, this
  10233.                     function will erase the an existing files in order to
  10234.                     re-use the name.  (In DOS, you cannot rename a file to
  10235.                     an existing name).  
  10236.  
  10237.           Example   See Jorf:Ini.
  10238.  
  10239.  
  10240.  
  10241.  
  10242.  
  10243.  
  10244.  
  10245.  
  10246.  
  10247.  
  10248.  
  10249.  
  10250.  
  10251.  
  10252.  
  10253.  
  10254.  
  10255.  
  10256.  
  10257.  
  10258.  
  10259.  
  10260.  
  10261.  
  10262.  
  10263.  
  10264.  
  10265.  
  10266.  
  10267.  
  10268.  
  10269.  
  10270.  
  10271.  
  10272.           Chapter Five - JORF Functions                                 161
  10273.  
  10274.  
  10275.  
  10276.  
  10277.  
  10278.  
  10279.  
  10280.  
  10281.                                       File:Save
  10282.  
  10283.  
  10284.           Function  File:Save ( Name, Text ) 
  10285.  
  10286.           Purpose   Save text to a file. 
  10287.  
  10288.           Returns   None.
  10289.  
  10290.           See Also  File:Load, File:Backup.
  10291.  
  10292.           Notes     Saves a text file wholesale from swap storage, which is
  10293.                     much faster than trying to write it line-by-line.  Does
  10294.                     not automatically make a backup so if you want one, use
  10295.                     File:Backup.
  10296.  
  10297.           Example   see Jorf:Write.
  10298.  
  10299.  
  10300.  
  10301.  
  10302.  
  10303.  
  10304.  
  10305.  
  10306.  
  10307.  
  10308.  
  10309.  
  10310.  
  10311.  
  10312.  
  10313.  
  10314.  
  10315.  
  10316.  
  10317.  
  10318.  
  10319.  
  10320.  
  10321.  
  10322.  
  10323.  
  10324.  
  10325.  
  10326.  
  10327.  
  10328.  
  10329.  
  10330.  
  10331.  
  10332.  
  10333.           The JORF Manual (Shareware Disk Version)                      162
  10334.  
  10335.  
  10336.  
  10337.  
  10338.  
  10339.  
  10340.  
  10341.  
  10342.                                       File:Write
  10343.  
  10344.  
  10345.           Function  File:Write ( Name, Line, Size, Offset ) 
  10346.  
  10347.           Purpose   Write a Record to a disk file.
  10348.  
  10349.           Returns   None.
  10350.  
  10351.           See Also  Other File Commands.
  10352.  
  10353.           Notes     Writes to the file for sequential or binary output. 
  10354.                     Name is required.  (In prior versions there was a
  10355.                     parameter Level that is now no longer used.  This
  10356.                     change is not upward compatible and you must be sure
  10357.                     that any programs for JORF versions prior to 2.1 are
  10358.                     corrected.)
  10359.            
  10360.                     The file is always opened for update and the file
  10361.                     pointer is placed at the beginning of the file.  If you
  10362.                     want to create a file, use File:Del to insure that the
  10363.                     file is new.  If you want to append data to the file,
  10364.                     use File:MoveTo to change the file pointer, or
  10365.                     File:Append to write directly to the last record
  10366.                     position in the file.
  10367.  
  10368.                     If Size is specified then Line will be null padded or
  10369.                     truncated to the length specified then written to file.
  10370.                     If Offset is specified then write will take place at
  10371.                     that position offset.  If not specified, a carriage
  10372.                     return line feed pair is appended and the line is
  10373.                     written in sequential mode.  
  10374.  
  10375.                     If Line is omitted or Null, and Size is zero the file
  10376.                     will be handled as a text file and a carriage return -
  10377.                     line feed pair will be appended to the file.  The only
  10378.                     way to write files without appending the CR-LF
  10379.                     characters is to write them using the Size parameter.
  10380.  
  10381.                     You can move to any byte position in a file by using
  10382.                     File:Read with a record size of 1.  You can move to the
  10383.                     front or back of a file using File:MoveTo.
  10384.  
  10385.                     Reading a file in comma delimited, fixed length and
  10386.                     dBase format may be influenced by using the File:Map
  10387.                     function. 
  10388.  
  10389.           Example   See DirList:GetFile for an example of writing a text
  10390.                     file.
  10391.  
  10392.  
  10393.  
  10394.           Chapter Five - JORF Functions                                 163
  10395.  
  10396.  
  10397.  
  10398.  
  10399.  
  10400.  
  10401.  
  10402.  
  10403.                                     For/Thru/Step
  10404.  
  10405.  
  10406.           Function  For/Thru/Step 
  10407.  
  10408.           Purpose   A counting loop. 
  10409.  
  10410.           Returns   None.
  10411.  
  10412.           See Also  While.
  10413.  
  10414.           Notes     A specialized loop based on a numeric counter.  Based
  10415.                     on the BASIC For/Next loop, there is no need for a
  10416.                     "Next" here because indentation makes the loop
  10417.                     structure clear.  
  10418.  
  10419.                     For ( Value = 1 Thru 10 Step 2 ) 
  10420.                         Lines to do 
  10421.  
  10422.                     The BASIC key word "To" has been changed to "Thru" for
  10423.                     the sake of accuracy.  If computers are literal, the
  10424.                     commands must also be literal.  (The BASIC loop uses
  10425.                     "To" but actually goes "Through" the value, a bit of
  10426.                     inaccuracy that is not appropriate for literal minded
  10427.                     computers.)
  10428.  
  10429.                     You can use Break to break out of a For loop, or
  10430.                     Continue to continue the loop, just like a While loop.
  10431.  
  10432.                     If the ending value is a function result or
  10433.                     mathematical equation, it is calculated only as the
  10434.                     loop is entered, and not for each iteration of the
  10435.                     loop.  
  10436.  
  10437.           Example   For loops always replace While loops as this example
  10438.                     shows:
  10439.  
  10440.                     For Loop                      While loop equivalent.
  10441.  
  10442.                     OnetoTen:Start                OnetoTen:Start
  10443.                       New (Num)                     New (Num)
  10444.                       Win:Add ("One to Ten")        Win:Add ("One to Ten")
  10445.                       |                             Num = 1
  10446.                       For (Num = 1 thru 10)         While (Num <= 10)
  10447.                            Str:PutLine (Num)          Str:PutLine (Num)
  10448.                       |                               ++Num
  10449.                       Return (Ok)                   Return (Ok)
  10450.  
  10451.                     In this case, the first time the loop is entered, Num
  10452.                     is initialized to 1.  It is the incremented by one,
  10453.  
  10454.  
  10455.           The JORF Manual (Shareware Disk Version)                      164
  10456.  
  10457.  
  10458.  
  10459.  
  10460.  
  10461.  
  10462.  
  10463.                     until it is greater than 10.  The loop then continues.
  10464.                     reaches 10.  
  10465.  
  10466.                     You can see in the above example that the initializer
  10467.                     and ending condition are in a single line, and the
  10468.                     incrementer is implied, so the For loop is contained in
  10469.                     a single line.  The while loop takes the usual three
  10470.                     lines to specify the initializer, ending condition and
  10471.                     incrementer.
  10472.  
  10473.                     There is one variation on the For loop, and that is to
  10474.                     have it increment by something other than 1.  For
  10475.                     instance, maybe we want to count by threes, or count
  10476.                     backwards from 10 to 1.  To do this, simply add a
  10477.                     "Step" command to the For loop:
  10478.  
  10479.  
  10480.                     For Loop                      While loop equivalent.
  10481.  
  10482.                     ByTwos:Start                  ByTwos:Start
  10483.                       New (Num)                     New (Num)
  10484.                       Win:Add ("One to Ten")        Win:Add ("One to Ten")
  10485.                       |                             Num = 1
  10486.                       For (Num = 1 thru 10 Step 2)  While (Num <= 10)
  10487.                            Str:PutLine (Num)          Str:PutLine (Num)
  10488.                       |                               Num = Num + 2
  10489.                       Return (Ok)                   Return (Ok)
  10490.  
  10491.  
  10492.                     For Loop                      While loop equivalent.
  10493.  
  10494.                     TentoOne:Start                TentoOne:Start
  10495.                       New (Num)                     New (Num)
  10496.                       Win:Add ("One to Ten")        Win:Add ("One to Ten")
  10497.                       |                             Num = 10
  10498.                       For (Num = 1 thru 10 Step -1)  While (Num >= 1)
  10499.                            Str:PutLine (Num)          Str:PutLine (Num)
  10500.                       |                               --Num
  10501.                       Return (Ok)                  Return (Ok)
  10502.  
  10503.  
  10504.  
  10505.  
  10506.  
  10507.  
  10508.  
  10509.  
  10510.  
  10511.  
  10512.  
  10513.  
  10514.  
  10515.  
  10516.           Chapter Five - JORF Functions                                 165
  10517.  
  10518.  
  10519.  
  10520.  
  10521.  
  10522.  
  10523.  
  10524.  
  10525.                                          Here
  10526.  
  10527.  
  10528.           Function  Here
  10529.  
  10530.           Purpose   Return the current method location.
  10531.  
  10532.           Returns   The current method location.
  10533.  
  10534.           See Also  Win:Add, Event:Add.
  10535.  
  10536.           Notes     Returns the current stack position as an unsigned
  10537.                     integer.  When the interpreter is started, this value
  10538.                     is 1, and each nested method increases the level by
  10539.                     one.  The highest stack level that can be expressed
  10540.                     this way is 65,535 (Hexadecimal ffff).  This command
  10541.                     provides a simple way of marking windows, files, and
  10542.                     events so The JORF Interpreter can automatically delete
  10543.                     them when you are done.
  10544.  
  10545.                     The complete display method for a window may be nested
  10546.                     several levels deep.  Usually, the call to the method
  10547.                     uses Here, and the various methods pass that value as a
  10548.                     parameter called Level.
  10549.  
  10550.                     It is not kosher to manipulate this value by adding or
  10551.                     subtracting from it.  Doing so will confuse the
  10552.                     automatic clearing mechanism, which may clear too
  10553.                     little or too much.
  10554.  
  10555.           Example   See Jorf:Write.
  10556.  
  10557.  
  10558.  
  10559.  
  10560.  
  10561.  
  10562.  
  10563.  
  10564.  
  10565.  
  10566.  
  10567.  
  10568.  
  10569.  
  10570.  
  10571.  
  10572.  
  10573.  
  10574.  
  10575.  
  10576.  
  10577.           The JORF Manual (Shareware Disk Version)                      166
  10578.  
  10579.  
  10580.  
  10581.  
  10582.  
  10583.  
  10584.  
  10585.  
  10586.                                        If/Else
  10587.  
  10588.  
  10589.           Function  If/Else
  10590.  
  10591.           Purpose   A conditional branch.
  10592.  
  10593.           Returns   None.
  10594.  
  10595.           See Also  Switch, While.
  10596.  
  10597.           Notes     Tests the value of a parameter and executes indented
  10598.                     code sections based on that value. 
  10599.  
  10600.                     If ( TestValue ) 
  10601.                       Lines to do if True
  10602.                     Else
  10603.                       Lines to do if False
  10604.  
  10605.                     The If function tests a condition and branches based on
  10606.                     that condition.  If the condition is true, then the
  10607.                     indented section is performed.  If the condition is not
  10608.                     true, then program flow skips to the Else command.  
  10609.  
  10610.                              If (A=2)
  10611.                                 B=4
  10612.                              Else 
  10613.                                 B=6
  10614.  
  10615.                     The condition does not have to be a logical comparison. 
  10616.                     A single variable may be used instead, in which case it
  10617.                     will be True if it has any value, and False if it is
  10618.                     null.
  10619.  
  10620.                             If (Word)
  10621.                               Str:Put (Word)
  10622.                             Else
  10623.                               Str:Put ("(Null)")
  10624.  
  10625.                     The condition may be a complex comparison involving
  10626.                     both logical and value elements
  10627.  
  10628.                             If (Counter > 3 && Word)
  10629.                               Str:Put ("Counter too large for {Word}")
  10630.                             Else
  10631.                               ++Counter
  10632.  
  10633.                     Parentheses around the If test is optional.  
  10634.  
  10635.  
  10636.  
  10637.  
  10638.           Chapter Five - JORF Functions                                 167
  10639.  
  10640.  
  10641.  
  10642.  
  10643.  
  10644.  
  10645.  
  10646.  
  10647.                                        Jorf:Cls
  10648.  
  10649.  
  10650.           Function  Jorf:Cls
  10651.  
  10652.           Purpose   Clear the DOS Screen.  Does nothing under Windows. 
  10653.  
  10654.           Returns   None. 
  10655.  
  10656.                     Both the DOS and the Windows versions of JORF place
  10657.                     windows on the previous screen contents.  Although this
  10658.                     is traditional for Windows programs, most DOS programs
  10659.                     clear the screen instead.  To allow you to follow this
  10660.                     custom, this command will clear the screen in the DOS
  10661.                     version of JORF. 
  10662.  
  10663.                     If you clear the screen while some windows have been
  10664.                     displayed, you will get some really weird results when
  10665.                     those windows are later "erased".   Be sure there are
  10666.                     no windows displayed when you clear the screen.
  10667.  
  10668.  
  10669.  
  10670.  
  10671.  
  10672.  
  10673.  
  10674.  
  10675.  
  10676.  
  10677.  
  10678.  
  10679.  
  10680.  
  10681.  
  10682.  
  10683.  
  10684.  
  10685.  
  10686.  
  10687.  
  10688.  
  10689.  
  10690.  
  10691.  
  10692.  
  10693.  
  10694.  
  10695.  
  10696.  
  10697.  
  10698.  
  10699.           The JORF Manual (Shareware Disk Version)                      168
  10700.  
  10701.  
  10702.  
  10703.  
  10704.  
  10705.  
  10706.  
  10707.  
  10708.                                        Jorf:Del
  10709.  
  10710.  
  10711.           Function  Jorf:Del ( Item ) 
  10712.  
  10713.           Purpose   Deletes data. 
  10714.  
  10715.           Returns   None.
  10716.  
  10717.           See Also  Jorf:Write.
  10718.  
  10719.           Notes     Deletes the data associated with Item.  This may be a
  10720.                     Structure or block of text.  To delete a method use
  10721.                     Method:Del.
  10722.  
  10723.                     The system automatically saves data when it is indexed
  10724.                     to the Rule system, and when you use the Jorf:Copy and
  10725.                     Jorf:Write commands.  The Data is a permanent part of
  10726.                     the data file until it is deleted with this function.
  10727.  
  10728.                     There is no harm in doing a precautionary delete for
  10729.                     item that has not been saved.
  10730.  
  10731.  
  10732.  
  10733.  
  10734.  
  10735.  
  10736.  
  10737.  
  10738.  
  10739.  
  10740.  
  10741.  
  10742.  
  10743.  
  10744.  
  10745.  
  10746.  
  10747.  
  10748.  
  10749.  
  10750.  
  10751.  
  10752.  
  10753.  
  10754.  
  10755.  
  10756.  
  10757.  
  10758.  
  10759.  
  10760.           Chapter Five - JORF Functions                                 169
  10761.  
  10762.  
  10763.  
  10764.  
  10765.  
  10766.  
  10767.  
  10768.  
  10769.                                        Jorf:Do
  10770.  
  10771.  
  10772.           Function  Jorf:Do ( MethodName ) 
  10773.  
  10774.           Purpose   Interpret a string as a command. 
  10775.  
  10776.           Returns   Return value of command.
  10777.  
  10778.           See Also  Event:Do.
  10779.  
  10780.           Notes     Interprets a string as if it were a command.  This is
  10781.                     used to execute a command that has been assembled using
  10782.                     string values.  This ability allows the assembly and
  10783.                     execution of new commands and methods by a program
  10784.                     which then immediately calls them.  
  10785.  
  10786.  
  10787.  
  10788.  
  10789.  
  10790.  
  10791.  
  10792.  
  10793.  
  10794.  
  10795.  
  10796.  
  10797.  
  10798.  
  10799.  
  10800.  
  10801.  
  10802.  
  10803.  
  10804.  
  10805.  
  10806.  
  10807.  
  10808.  
  10809.  
  10810.  
  10811.  
  10812.  
  10813.  
  10814.  
  10815.  
  10816.  
  10817.  
  10818.  
  10819.  
  10820.  
  10821.           The JORF Manual (Shareware Disk Version)                      170
  10822.  
  10823.  
  10824.  
  10825.  
  10826.  
  10827.  
  10828.  
  10829.  
  10830.                                        Jorf:Dup
  10831.  
  10832.  
  10833.           Function  Jorf:Dup ( Item ) 
  10834.  
  10835.           Purpose   Make a copy of a Text or Structure.
  10836.  
  10837.           Returns   A duplicate copy of Item.
  10838.  
  10839.           See Also  Jorf:Del.
  10840.  
  10841.           Notes     This command is used to create a duplicate copy of Item
  10842.                     so you can change it without affecting the original. 
  10843.                     This command will automatically write both copies to
  10844.                     the current project file, so if they are temporary,
  10845.                     they must be deleted using Jorf:Del.
  10846.  
  10847.           Example   See Jorf:Del.
  10848.  
  10849.  
  10850.  
  10851.  
  10852.  
  10853.  
  10854.  
  10855.  
  10856.  
  10857.  
  10858.  
  10859.  
  10860.  
  10861.  
  10862.  
  10863.  
  10864.  
  10865.  
  10866.  
  10867.  
  10868.  
  10869.  
  10870.  
  10871.  
  10872.  
  10873.  
  10874.  
  10875.  
  10876.  
  10877.  
  10878.  
  10879.  
  10880.  
  10881.  
  10882.           Chapter Five - JORF Functions                                 171
  10883.  
  10884.  
  10885.  
  10886.  
  10887.  
  10888.  
  10889.  
  10890.  
  10891.                                       Jorf:Exit
  10892.  
  10893.  
  10894.           Function  Jorf:Exit ( Status, Message, Command ) 
  10895.  
  10896.           Purpose   Exit from The JORF Interpreter.
  10897.  
  10898.           Returns   Does not return.
  10899.  
  10900.           See Also  Jorf:System.
  10901.  
  10902.           Notes     Flushes disk caches and memory items, closes all files
  10903.                     and windows, exits to the operating system.  This
  10904.                     function is called involuntarily when a fatal error
  10905.                     occurs.  
  10906.  
  10907.                     If Status has a value, this is returned to the
  10908.                     operating system.  Under windows 3.1 the program return
  10909.                     value is not supported but maybe Mr. Microsoft will fix
  10910.                     this someday.  
  10911.  
  10912.                     If Message has a value, it is displayed after the
  10913.                     original screen is restored in DOS, or in a message box
  10914.                     under Windows.  Generally, Message is used only to
  10915.                     report fatal errors.
  10916.  
  10917.                     The Command may be used to chain to other programs. 
  10918.                     Under DOS, the command is chained using COMMAND.COM /C
  10919.                     to support batch files and full path specs.  This
  10920.                     command is omitted on the windows version to allow you
  10921.                     to chain to a Windows program.  If you are running the
  10922.                     Windows version and want to chain to a DOS program, you
  10923.                     will have to prefix your DOS command line with
  10924.                     COMMAND.COM /C.
  10925.  
  10926.                     In general, you can chain to any batch file, .COM file
  10927.                     or .EXE file, and can pass up to 10 parameters (or 110
  10928.                     bytes whichever is longer) to that file.
  10929.  
  10930.  
  10931.  
  10932.  
  10933.  
  10934.  
  10935.  
  10936.  
  10937.  
  10938.  
  10939.  
  10940.  
  10941.  
  10942.  
  10943.           The JORF Manual (Shareware Disk Version)                      172
  10944.  
  10945.  
  10946.  
  10947.  
  10948.  
  10949.  
  10950.  
  10951.  
  10952.                                       Jorf:File
  10953.  
  10954.  
  10955.           Function  Jorf:File ( Name Level ) 
  10956.  
  10957.           Purpose   Declares a project file, gets the name of existing
  10958.                     project file.
  10959.  
  10960.           Returns   Previous project file name.
  10961.  
  10962.           Notes     Project files hold indexes and data, classes and
  10963.                     methods.  All of a JORF language application can run
  10964.                     out of a single project file.  However, it is
  10965.                     advantageous to split various types of information into
  10966.                     various files.  Jorf:File declares a new file to be
  10967.                     used by the interpreter.
  10968.  
  10969.                     The new file is tied to the stack using Level, which
  10970.                     must be the value of Here from the calling method.  If
  10971.                     the name and level are absent, this function just
  10972.                     returns the current file.  If they are present, the new
  10973.                     file is used by the interpreter.
  10974.  
  10975.                     Methods are searched in the current file, and then in
  10976.                     the base project METHODS.JRF.  The system also
  10977.                     allocates a project called SWAPFILE.JRF for memory
  10978.                     swapping.  Indexed data is searched only in the current
  10979.                     file.
  10980.  
  10981.                     I created this use of files without precedent or
  10982.                     experience.  It much looser than any file definition I
  10983.                     have ever seen in a computer system.  However, it
  10984.                     works, and it has some redeeming features.  For one,
  10985.                     the files are established in relative positions, and
  10986.                     may be freely moved or renamed without compromising the
  10987.                     data in those files.  A file may even be shipped to
  10988.                     another system, and used without any further set up. 
  10989.                     This works because the interpreter insures that the
  10990.                     data and indexes in a given project file are always
  10991.                     synchronized.
  10992.  
  10993.                     The other redeeming feature is the simplicity of the
  10994.                     scheme.  You don't really open the file, allocate it,
  10995.                     expand it or close it.  This command basically says
  10996.                     "Use this file for a while" and the interpreter does. 
  10997.  
  10998.           Also Note When creating a program in the debugger, the
  10999.                     interpreter automatically does a Jorf:File for the file
  11000.                     you are working on.  For instance, when you load the
  11001.                     Haiku.J source file, the interpreter executes
  11002.                     Jorf:File("Haiku.Jrf",Here) before it runs the program. 
  11003.  
  11004.           Chapter Five - JORF Functions                                 173
  11005.  
  11006.  
  11007.  
  11008.  
  11009.  
  11010.  
  11011.  
  11012.                     However, if you translate your program to the C
  11013.                     language, and compile it, the interpreter is no longer
  11014.                     available, and you must open the file yourself. 
  11015.  
  11016.                     The best explanation of how this system works comes
  11017.                     from running the interpreter with the Memory Info=Yes
  11018.                     flag set in the JORF.INI file.  This creates a display
  11019.                     of memory usage and current file information.
  11020.  
  11021.                     If you run the tutorial, you can watch the system
  11022.                     switch to the tutorial file, and the help file, when
  11023.                     you enter those menus. 
  11024.  
  11025.                     The following command will flush if there is less than
  11026.                     50 K (or 51,200) bytes available in the free memory
  11027.                     pool:
  11028.  
  11029.                          Jorf:Flush( 50 )
  11030.  
  11031.  
  11032.           Example   See Jorf:Write.
  11033.  
  11034.  
  11035.  
  11036.  
  11037.  
  11038.  
  11039.  
  11040.  
  11041.  
  11042.  
  11043.  
  11044.  
  11045.  
  11046.  
  11047.  
  11048.  
  11049.  
  11050.  
  11051.  
  11052.  
  11053.  
  11054.  
  11055.  
  11056.  
  11057.  
  11058.  
  11059.  
  11060.  
  11061.  
  11062.  
  11063.  
  11064.  
  11065.           The JORF Manual (Shareware Disk Version)                      174
  11066.  
  11067.  
  11068.  
  11069.  
  11070.  
  11071.  
  11072.  
  11073.  
  11074.                                       Jorf:Flush
  11075.  
  11076.  
  11077.           Function  Jorf:Flush ( Size ) 
  11078.  
  11079.           Purpose   Flushes memory to disk. 
  11080.  
  11081.           Returns   None.
  11082.  
  11083.           Notes     If Size is present and not zero, checks to see if that
  11084.                     much memory (in kilobytes) is available.  If so, then
  11085.                     does nothing.  If not, then flushes memory to obtain
  11086.                     space.  Always flushes if Size is zero or absent.  This
  11087.                     command may be used to insure that a particular
  11088.                     procedure, like obtaining entry from a data input
  11089.                     screen, can be completed without unnecessary delays due
  11090.                     to memory flushes.
  11091.  
  11092.                     Items that are flushed generally fall into two
  11093.                     categories; items that are needed again, and items that
  11094.                     are not.  Those which are needed again will be read
  11095.                     from disk resulting in spectacular performance
  11096.                     degradation.  Those which are not will stay on disk
  11097.                     where they belong.
  11098.  
  11099.                     JORF uses this command internally whenever it runs out
  11100.                     of memory.  It is supplied here as a Function because
  11101.                     some Methods may see improved performance if memory is
  11102.                     checked and flushed before or after they are invoked.  
  11103.  
  11104.  
  11105.  
  11106.  
  11107.  
  11108.  
  11109.  
  11110.  
  11111.  
  11112.  
  11113.  
  11114.  
  11115.  
  11116.  
  11117.  
  11118.  
  11119.  
  11120.  
  11121.  
  11122.  
  11123.  
  11124.  
  11125.  
  11126.           Chapter Five - JORF Functions                                 175
  11127.  
  11128.  
  11129.  
  11130.  
  11131.  
  11132.  
  11133.  
  11134.  
  11135.                                       Jorf:Info
  11136.  
  11137.  
  11138.           Function  Jorf:Info ( InfoValue )
  11139.  
  11140.           Purpose   Get information about the JORF environment. 
  11141.  
  11142.           Returns   None.
  11143.  
  11144.           Notes     The variable InfoValue should be a string with one of
  11145.                     the following values.  The return value is as noted. 
  11146.                     This function is a catchall to pass some quirky
  11147.                     internal values and DOS environment values to JORF
  11148.                     language programs.
  11149.  
  11150.                     Value               Returned Value
  11151.  
  11152.                     NumFiles       Number of JORF files open
  11153.                     MemFree        Current free memory
  11154.                     DosVer         MS-DOS Version
  11155.                     DiskFree       Amount of free disk space
  11156.                     DiskCap        Capacity of current disk
  11157.                     Windows        TRUE for Windows version
  11158.                     Graphics       TRUE if in graphics mode
  11159.                     Env:Value      If Value is in DOS environment, returns
  11160.                                    environment value.  Otherwise returns
  11161.                                    Null.
  11162.  
  11163.                     If you use the letters "ENV" followed by a colon, and
  11164.                     then the name of a DOS Environment variable, the value
  11165.                     of that variable is returned.  For instance, to get the
  11166.                     current DOS path, use the  command Jorf:Info (
  11167.                     "Env:PATH" ).  Upper and lower case does not matter,
  11168.                     even for the environment variable name.
  11169.  
  11170.                     More values are intended in the future.  If you need a
  11171.                     DOS environment value for your application, please give
  11172.                     a call.  If it does not require too much additional
  11173.                     code (The size of the EXE file in the DOS version is
  11174.                     really maxed out) I will try to add it for you.
  11175.  
  11176.           Example   See Jorf:System, sample program DOS.J which checks
  11177.                     "Windows" to see if you are running the Windows
  11178.                     version.
  11179.  
  11180.  
  11181.  
  11182.  
  11183.  
  11184.  
  11185.  
  11186.  
  11187.           The JORF Manual (Shareware Disk Version)                      176
  11188.  
  11189.  
  11190.  
  11191.  
  11192.  
  11193.  
  11194.  
  11195.  
  11196.                                        Jorf:Ini
  11197.  
  11198.  
  11199.           Function  Jorf:Ini 
  11200.  
  11201.           Purpose   Re-read JORF.INI file.
  11202.  
  11203.           Returns   None.
  11204.  
  11205.           Notes     A large number of system parameters are set in the
  11206.                     JORF.INI and JORFWIN.INI files.  This function allows
  11207.                     you to change these values inside a JORF program.  To
  11208.                     set new values, write to the file using the normal file
  11209.                     read and file write commands.  Then call Jorf:Ini() to
  11210.                     reset the initialization parameters.
  11211.  
  11212.                     If you change video mode or screen colors, the windows
  11213.                     that have already been displayed will not be changed. 
  11214.                     To effect a change, you will have to remove all windows
  11215.                     and redisplay them from scratch.  There is currently no
  11216.                     automatic system for re-displaying the windows to reset
  11217.                     colors.
  11218.  
  11219.           Example   This predecessor to the EDITINI.J sample file could
  11220.                     actually change colors on-the-fly.  It is dangerous to
  11221.                     change other parameters, like MultiUser.
  11222.  
  11223.           Colorset:Start
  11224.             New (IniFile)
  11225.             IniFile   = Str:At(Mem:Ptr->Args,1,Str:In(Mem:Ptr->Args,'.'))  
  11226.             IniFile   = IniFile+'INI'
  11227.             Event:Add()
  11228.             While (Ok)
  11229.               Win:Add ("Set Colors")
  11230.                 MLine:"&Bright Blue    "  Action:"ColorSet:Set('Blue')"
  11231.                 MLine:"&Windows White  "  Action:"ColorSet:Set('White')"
  11232.                 MLine:"&JORF Default   "  Action:"ColorSet:Set('Default')"
  11233.                 MLine:"&Grey Green     "  Action:"ColorSet:Set('Gray')"
  11234.                 MLine:"&Emerald Green  "  Action:"ColorSet:Set('Green')"
  11235.                 MLine:"&Monochrome     "  Action:"ColorSet:Set('Mono')"
  11236.                 MLine:"&Rev Monochrome "  Action:"ColorSet:Set('RevMono')"
  11237.                 MLine:"E&xit           "  Action:"Return('Esc_Key')"
  11238.               Win:Del
  11239.               If (Kbd:Got=='Esc_Key' Or Kbd:Got=='X_Key')
  11240.                 Break
  11241.             Return Ok
  11242.  
  11243.           ColorSet:Set(Color)
  11244.             New (Line,Indent)
  11245.             If (Str:In(IniFile,"WIN")==0)
  11246.               | Setting DOS colors
  11247.  
  11248.           Chapter Five - JORF Functions                                 177
  11249.  
  11250.  
  11251.  
  11252.  
  11253.  
  11254.  
  11255.  
  11256.               Switch (Color)
  11257.                 Case 'Blue'
  11258.              Colorset:Write
  11259.                +Mono/Color=Mono
  11260.                +Line Style=single
  11261.                +Border=Bright Cyan/Blue
  11262.                +Title=Bright White/Cyan
  11263.                +Shadow=White/Black
  11264.                +Normal=Bright Cyan/Blue
  11265.                +Low=Bright White/Blue
  11266.                +Medium=Light Blue/Blue
  11267.                +High=Bright White/Cyan
  11268.                +Bold=Bright Cyan/Cyan
  11269.                +Message=Yellow/Blue
  11270.                 Case 'White'
  11271.              Colorset:Write
  11272.                +Mono/Color=Mono
  11273.                +Line Style=Thick
  11274.                +Border Color=Bright White/White
  11275.                +Title Color=Bright White/White
  11276.                +Shadow Color=Black/Gray
  11277.                +Message Color=Gray/White
  11278.                +Normal Color=Bright White/White
  11279.                +Low Color=Gray/White
  11280.                +Medium Color=Bright White/White
  11281.                +High Color=White/Gray
  11282.                +Bold Color=Bright White/Gray
  11283.                 Case 'Default'
  11284.              Colorset:Write
  11285.                +Mono/Color=Mono
  11286.                +Line Style=single
  11287.                +Border=Bright White/White
  11288.                +Title=Light Blue/White
  11289.                +Shadow=Light Magenta/Blue
  11290.                +Normal=Bright White/White
  11291.                +Low=Yellow/White
  11292.                +Medium=Light Blue/White
  11293.                +High=Yellow/Blue
  11294.                +Bold=Bright White/Blue
  11295.                +Message=Yellow/White
  11296.                 Case 'Gray'
  11297.              Colorset:Write
  11298.                +Mono/Color=Mono
  11299.                +Line Style=Double
  11300.                +Border Color=Bright Cyan/Gray
  11301.                +Title Color=Bright White/Gray
  11302.                +Shadow Color=Cyan/Black
  11303.                +Message Color=Bright Yellow/Gray
  11304.                +Normal Color=Bright White/Gray
  11305.                +Low Color=Bright Yellow/Gray
  11306.                +Medium Color=Bright Cyan/Gray
  11307.                +High Color=Bright Yellow/Cyan
  11308.  
  11309.           The JORF Manual (Shareware Disk Version)                      178
  11310.  
  11311.  
  11312.  
  11313.  
  11314.  
  11315.  
  11316.  
  11317.                +Bold Color=Bright White/Cyan
  11318.                 Case 'Green'
  11319.              Colorset:Write
  11320.                +Mono/Color=Mono
  11321.                +Line Style=Double
  11322.                +Border Color=Bright Green/Cyan
  11323.                +Title Color=Bright White/Green
  11324.                +Shadow Color=Cyan/Black
  11325.                +Message Color=Bright Yellow/Cyan
  11326.                +Normal Color=Bright White/Cyan
  11327.                +Low Color=Bright Yellow/Cyan
  11328.                +Medium Color=Bright Cyan/Cyan
  11329.                +High Color=Bright Yellow/Gray
  11330.                +Bold Color=Bright White/Gray
  11331.                 Case 'Mono'
  11332.              Colorset:Write
  11333.                +Mono/Color=Mono
  11334.                +Line Style=Double
  11335.                +Border Color=Bright White/Black
  11336.                +Title Color=Bright White/Black
  11337.                +Shadow Color=White/Black
  11338.                +Message Color=Bright White/Black
  11339.                +Normal Color=White/Black
  11340.                +Low Color=Bright White/Black
  11341.                +Medium Color=White/Black
  11342.                +High Color=Black/White
  11343.                +Bold Color=Black/White
  11344.                 Case 'RevMono'
  11345.              Colorset:Write
  11346.                +Mono/Color=Mono
  11347.                +Line Style=Double
  11348.                +Border Color=Black/White
  11349.                +Title Color=Black/Bright White
  11350.                +Shadow Color=White/Black
  11351.                +Message Color=Black/Bright White
  11352.                +Normal Color=Black/White
  11353.                +Low Color=Black/Bright White
  11354.                +Medium Color=Black/White
  11355.                +High Color=White/Black
  11356.                +Bold Color=Bright White/Black
  11357.             Return (Ok)
  11358.  
  11359.           ColorSet:Write(NewText)
  11360.             New (NewFile,Found)
  11361.             Win:Add
  11362.               Rewriting INI file
  11363.             NewFile = Str:At(IniFile,1,Str:In(IniFile,'.')) + "NEW"
  11364.             File:Del(NewFile)
  11365.             File:Open(NewFile,Here)
  11366.             File:Open(IniFile,Here)
  11367.             While (File:Ok(IniFile))
  11368.               Line = File:Read(IniFile)
  11369.  
  11370.           Chapter Five - JORF Functions                                 179
  11371.  
  11372.  
  11373.  
  11374.  
  11375.  
  11376.  
  11377.  
  11378.               If (Str:In (Line,"Window") And Str:In (Line,"Text"))
  11379.                 Found=True
  11380.                 File:Write(NewFile,"Window=Text")
  11381.                 Indent = Str:Ind(NewText)
  11382.                 While (Str:Ind(NewText)>=Indent)
  11383.              File:Write(NewFile,Str:At(NewText,Indent))
  11384.              NewText=Text:Next(NewText)
  11385.                 While (File:Ok(IniFile))
  11386.              Line=File:Read(IniFile)
  11387.              If (Str:At(Line,1,1)!='+')
  11388.                Break
  11389.               File:Write(NewFile,Line)
  11390.             If (Found==Null)
  11391.               Msg:Add
  11392.                 Could not find Window=Text
  11393.                 line in the INI file.
  11394.             Else
  11395.               File:Backup(IniFile)
  11396.               File:Rename(NewFile,IniFile)
  11397.             Jorf:Ini()             | <--Here it is way at the bottom
  11398.             Return (Null)
  11399.  
  11400.  
  11401.  
  11402.  
  11403.  
  11404.  
  11405.  
  11406.  
  11407.  
  11408.  
  11409.  
  11410.  
  11411.  
  11412.  
  11413.  
  11414.  
  11415.  
  11416.  
  11417.  
  11418.  
  11419.  
  11420.  
  11421.  
  11422.  
  11423.  
  11424.  
  11425.  
  11426.  
  11427.  
  11428.  
  11429.  
  11430.  
  11431.           The JORF Manual (Shareware Disk Version)                      180
  11432.  
  11433.  
  11434.  
  11435.  
  11436.  
  11437.  
  11438.  
  11439.  
  11440.                                       Jorf:Lock
  11441.  
  11442.  
  11443.           Function  Jorf:Lock( Structure ) 
  11444.  
  11445.           Purpose   Locks a record, reports locked status. 
  11446.  
  11447.           Returns   Null if record is already locked, OK if a new lock was
  11448.                     placed.
  11449.  
  11450.           See Also  Jorf:Unlock, Jorf:Write.
  11451.  
  11452.           Notes     The Structure is a JORF language structure that is used
  11453.                     to hold fields to be stored to the disk.  This function
  11454.                     works with Jorf:Unlock and Jorf:Write to enable you to
  11455.                     do record level locking.  
  11456.  
  11457.                     Record locking is used to prevent two people from
  11458.                     changing the same record at the same time.  If you do
  11459.                     not have "Multiuser=Yes" set in your JORF.INI or
  11460.                     JORFWIN.INI file then this function has no effect.
  11461.  
  11462.                     To prevent two people from editing a record, the record
  11463.                     must be locked whenever it is being changed.  In JORF,
  11464.                     the process of locking and the process of checking
  11465.                     whether a lock is in place are both done using the
  11466.                     Jorf:Lock function.  Before editing a record
  11467.                     (structure), you should call this command.  
  11468.  
  11469.                     If the Jorf:Lock result code is OK, (OK, Numeric 1, or
  11470.                     True are the same in the JORF language) then you have
  11471.                     locked the record properly and the edit can continue. 
  11472.                     If the result code is NULL (or 0) then someone else has
  11473.                     the record locked and you should not edit it.  In
  11474.                     multiuser systems, structures are re-read from disk
  11475.                     when locked to insure they contain information that may
  11476.                     have been written by another operator just prior to
  11477.                     locking by the current operator.
  11478.  
  11479.                     When the editing is complete you have the choice of
  11480.                     aborting the change, or accepting the change and
  11481.                     writing to disk.  If you wish to abort, use the
  11482.                     Jorf:unlock function.  This function unlocks the record
  11483.                     and re-reads it from file, restoring the original
  11484.                     values.  To keep the changed information, use
  11485.                     Jorf:Write, which will write the changed data and
  11486.                     automatically unlock the record.  
  11487.  
  11488.                     If you fail to unlock or write the record after
  11489.                     locking, it will remain locked until the file is
  11490.                     rebuilt using Jorf:Rebuild.  This is very bad to have
  11491.  
  11492.           Chapter Five - JORF Functions                                 181
  11493.  
  11494.  
  11495.  
  11496.  
  11497.  
  11498.  
  11499.  
  11500.                     records locked, and you should never allow a function
  11501.                     to exit without unlocking or writing the current
  11502.                     record. 
  11503.  
  11504.                     For File Pros:  The JORF locking system does more than
  11505.                     just set a software lock.  It actually locks only the
  11506.                     header of the file long enough to write a physical
  11507.                     marker in the stored record, the record is rewritten
  11508.                     and header is unlocked.  That is why a locked record
  11509.                     remains locked, even though you exit JORF and even
  11510.                     reboot your computer.  The Jorf:Rebuild function runs
  11511.                     under an exclusive file lock and automatically clears
  11512.                     releases the physical lock bit for all records.  Locked
  11513.                     records are not owned, so one user (or supervisor
  11514.                     function) can unlock a record locked by another user. 
  11515.  
  11516.                     For File Novices:  A common problem happens in programs
  11517.                     that use multiple file locks.  If the program locks two
  11518.                     records in one place, and two records in another place
  11519.                     (say a contact record and an order record)  you can get
  11520.                     a situation called deadlock.  This happens when one
  11521.                     operator locks the first, another operator locks the
  11522.                     second, and the function the first operator is running
  11523.                     does not release the first until the second is
  11524.                     available.  Like the name implies, Deadlock is to be
  11525.                     avoided at all costs.
  11526.  
  11527.                     Three ways to avoid deadlock are:
  11528.  
  11529.                          A sure way:  Avoid ever having two file locks.  A
  11530.                          creative programmer will realize that while we are
  11531.                          editing the Order, we are not editing the Contact,
  11532.                          and set locks accordingly.  If you never lock two
  11533.                          records at once, you cannot have deadlock.
  11534.  
  11535.                          A good way:  Always lock files in the same order,
  11536.                          and unlock them in reverse order of locking. 
  11537.                          Always lock Contact, then Order, and release Order
  11538.                          then Contact.  This will always work, but requires
  11539.                          discipline and planning, especially when you
  11540.                          consider that reports and batch processes may also
  11541.                          be locking and releasing the records.
  11542.  
  11543.                          A bad way:  If the second record is locked,
  11544.                          release the first while waiting for the second to
  11545.                          be released.  This is a kludge that requires even
  11546.                          more discipline and planning.  One mistake and you
  11547.                          will still have deadlock.
  11548.  
  11549.                     There are other techniques to avoid deadlock.  The
  11550.                     worst way is to ignore it.  You might think "This data
  11551.                     base has 10,000 records so there is only a 1 in 10,000
  11552.  
  11553.           The JORF Manual (Shareware Disk Version)                      182
  11554.  
  11555.  
  11556.  
  11557.  
  11558.  
  11559.  
  11560.  
  11561.                     chance that two operators will be in the same record". 
  11562.                     In real life it is common to see an operator who is
  11563.                     modifying a record, has a question and goes to consult
  11564.                     another operator who attempts to modify the same
  11565.                     record.  Or the case where two salespeople are both
  11566.                     working on a very important customer's order.  Taking
  11567.                     care with your locking is necessary to insure that your
  11568.                     application runs smoothly in all these circumstances.
  11569.  
  11570.  
  11571.  
  11572.  
  11573.  
  11574.  
  11575.  
  11576.  
  11577.  
  11578.  
  11579.  
  11580.  
  11581.  
  11582.  
  11583.  
  11584.  
  11585.  
  11586.  
  11587.  
  11588.  
  11589.  
  11590.  
  11591.  
  11592.  
  11593.  
  11594.  
  11595.  
  11596.  
  11597.  
  11598.  
  11599.  
  11600.  
  11601.  
  11602.  
  11603.  
  11604.  
  11605.  
  11606.  
  11607.  
  11608.  
  11609.  
  11610.  
  11611.  
  11612.  
  11613.  
  11614.           Chapter Five - JORF Functions                                 183
  11615.  
  11616.  
  11617.  
  11618.  
  11619.  
  11620.  
  11621.  
  11622.  
  11623.                                       Jorf:Move
  11624.  
  11625.  
  11626.           Function  Jorf:Move (Source, Dest, Class )
  11627.  
  11628.           Purpose   Move elements of a structure.
  11629.  
  11630.           Returns   None.
  11631.  
  11632.           Notes     If you just want to duplicate a structure, use
  11633.                     Jorf:Dupe.  Sometimes, however, you want to transfer
  11634.                     only like-named elements of a structure.  For that
  11635.                     reason alone this function exists.
  11636.  
  11637.                     The use of this function is pretty obscure.  Lets say
  11638.                     you have a structure like "C" which is a member of the
  11639.                     "Control" class, and it shares elements with a
  11640.                     structure like "P" which is a member of the "Project"
  11641.                     class.  You can quickly transfer "Project"  elements
  11642.                     with the following command:
  11643.  
  11644.                          Jorf:Move ( C, P, "Project")
  11645.  
  11646.  
  11647.                     Note the class name is passed as a string, and must be
  11648.                     quoted.
  11649.  
  11650.                     An even more obscure use of this command is to set
  11651.                     specific elements to blank.  You can do this by using
  11652.                     Null as the source.  You can set all elements without
  11653.                     specifying a class, or only the elements of a class.
  11654.  
  11655.                     Jorf:Move (Null, P)      | Blank out Project P
  11656.                     Jorf:Move (Null, C, "Project")     | Blank out "Project" elements of C 
  11657.  
  11658.  
  11659.  
  11660.  
  11661.  
  11662.  
  11663.  
  11664.  
  11665.  
  11666.  
  11667.  
  11668.  
  11669.  
  11670.  
  11671.  
  11672.  
  11673.  
  11674.  
  11675.           The JORF Manual (Shareware Disk Version)                      184
  11676.  
  11677.  
  11678.  
  11679.  
  11680.  
  11681.  
  11682.  
  11683.  
  11684.                                       Jorf:Pack
  11685.  
  11686.  
  11687.           Function  Jorf:Pack 
  11688.  
  11689.           Purpose   Packs a JORF file. 
  11690.  
  11691.           Returns   None.
  11692.  
  11693.           See Also  Jorf:Rebuild.
  11694.  
  11695.           Notes     Converts the current JORF file to a special ASCII file
  11696.                     format.  This format retains all data, but omits any
  11697.                     indexes.  It also contains offsets to recursive
  11698.                     structures and sparse structures such as large arrays. 
  11699.                     Packed files have the extension JPK.
  11700.  
  11701.                     Because the packed format does not contain indexes, it
  11702.                     is usually half the size of the .JRF file.  This file
  11703.                     can be used to rebuild a .JRF file.  The file must be
  11704.                     rebuilt with the appropriate class definitions, so that
  11705.                     indexes are added properly.
  11706.  
  11707.  
  11708.  
  11709.  
  11710.  
  11711.  
  11712.  
  11713.  
  11714.  
  11715.  
  11716.  
  11717.  
  11718.  
  11719.  
  11720.  
  11721.  
  11722.  
  11723.  
  11724.  
  11725.  
  11726.  
  11727.  
  11728.  
  11729.  
  11730.  
  11731.  
  11732.  
  11733.  
  11734.  
  11735.  
  11736.           Chapter Five - JORF Functions                                 185
  11737.  
  11738.  
  11739.  
  11740.  
  11741.  
  11742.  
  11743.  
  11744.  
  11745.                                      Jorf:Printer
  11746.  
  11747.  
  11748.  
  11749.           Function  Jorf:Printer
  11750.  
  11751.           Purpose   Displays a preprogrammed printer selection box.
  11752.  
  11753.           Returns   None.
  11754.  
  11755.           See Also  Arr:Printers, File:Print
  11756.  
  11757.           Notes     This command displays a standard pre-programmed printer
  11758.                     selection box to save you the time of creating one.  It
  11759.                     is really a JORF language routine, translated and
  11760.                     compiled into the JORF interpreter.  The example below
  11761.                     shows the actual code for this routine.
  11762.  
  11763.           Example
  11764.  
  11765.           Jorf:Printer
  11766.             New (PrintList,PrintChoice,Dest)
  11767.  
  11768.             Event:Add()
  11769.             PrintList = Arr:Printers()
  11770.             Win:Add("Select Printer")
  11771.               Group:"&Printers", Row:1 Col:1 Len:6 Wid:22
  11772.               Array:"" Field:"PrintList" Choice:"PrintChoice"
  11773.  
  11774.               Button:"   &Go   " Row:1 Col:32
  11775.                 Action:"Dest=PrintList[PrintChoice]"
  11776.               Button:" &Cancel " Row:4 Col:32 Action:"Return ('Esc_Key')"
  11777.             If (Dest='Esc_Key' Or Kbd:Got='Esc_Key')
  11778.               Dest=Null
  11779.             Return(Dest)
  11780.  
  11781.  
  11782.  
  11783.  
  11784.  
  11785.  
  11786.  
  11787.  
  11788.  
  11789.  
  11790.  
  11791.  
  11792.  
  11793.  
  11794.  
  11795.  
  11796.  
  11797.           The JORF Manual (Shareware Disk Version)                      186
  11798.  
  11799.  
  11800.  
  11801.  
  11802.  
  11803.  
  11804.  
  11805.  
  11806.                                      Jorf:Rebuild
  11807.  
  11808.  
  11809.           Function  Jorf:Rebuild 
  11810.  
  11811.           Purpose   Packs and rebuilds a JORF file. 
  11812.  
  11813.           Returns   None.
  11814.  
  11815.           See Also  Jorf:Pack.
  11816.  
  11817.           Notes     Rebuilds a .JRF file by copying data to an ASCII
  11818.                     format, erasing the original, and reading the ASCII
  11819.                     data back in.  Indexes are not copied, and are re-
  11820.                     created after the data is read.
  11821.  
  11822.                     To rebuild a file, you must not be using any methods or
  11823.                     data in that file.  The rebuild will clear live
  11824.                     pointers (which are changing position) so you will have
  11825.                     to redraw your screens after rebuilding..
  11826.  
  11827.                     You can rebuild from the command line using the -R
  11828.                     option.  You must first specify the file that contains
  11829.                     the class definitions, and then -R and then the file(s)
  11830.                     you want rebuilt.
  11831.  
  11832.                     C>JORF Contact -R Maillist.JCM
  11833.  
  11834.                     The command above rebuilds the file Maillist.JCM
  11835.                     according to the class definition found in Contact.J.
  11836.  
  11837.  
  11838.  
  11839.  
  11840.  
  11841.  
  11842.  
  11843.  
  11844.  
  11845.  
  11846.  
  11847.  
  11848.  
  11849.  
  11850.  
  11851.  
  11852.  
  11853.  
  11854.  
  11855.  
  11856.  
  11857.  
  11858.           Chapter Five - JORF Functions                                 187
  11859.  
  11860.  
  11861.  
  11862.  
  11863.  
  11864.  
  11865.  
  11866.  
  11867.                                       Jorf:Sound
  11868.  
  11869.  
  11870.           Function  Jorf:Sound ( Frequency, Duration ) 
  11871.  
  11872.           Purpose   Make beautiful music. 
  11873.  
  11874.           Returns   None.
  11875.  
  11876.           Notes     The built in sound capability in the IBM PC style
  11877.                     computer is very primitive.  You cannot control volume
  11878.                     and the PC uses a square wave that sounds very
  11879.                     mechanical. 
  11880.  
  11881.                     This command makes a sound at the specified Frequency
  11882.                     for at least the specified Duration (in 18ths of a
  11883.                     second).  The sound ends when the duration is ended.  
  11884.  
  11885.                     Using a frequency below 20 may be inaudible or may
  11886.                     damage some computer speakers.
  11887.  
  11888.  
  11889.  
  11890.  
  11891.  
  11892.  
  11893.  
  11894.  
  11895.  
  11896.  
  11897.  
  11898.  
  11899.  
  11900.  
  11901.  
  11902.  
  11903.  
  11904.  
  11905.  
  11906.  
  11907.  
  11908.  
  11909.  
  11910.  
  11911.  
  11912.  
  11913.  
  11914.  
  11915.  
  11916.  
  11917.  
  11918.  
  11919.           The JORF Manual (Shareware Disk Version)                      188
  11920.  
  11921.  
  11922.  
  11923.  
  11924.  
  11925.  
  11926.  
  11927.  
  11928.           Example   I had a lot of fun writing MUSIC.J. 
  11929.  
  11930.           Music:Start
  11931.             New(Response,Row,Col,Forg,Back,Tone,Time)
  11932.             Response=Msg:Add("Beautiful Music")
  11933.               This 42 line program generates random music.  Just in case you
  11934.               do not like random music, I have made the program display a
  11935.               tapestry of color proclaiming Beautiful Music to convince you.
  11936.  
  11937.               It is a demonstration for these functions:
  11938.  
  11939.                 Num:Rand(Lo,Hi)         -Generates random numbers
  11940.                 Jorf:Sound(Tone,Duration)    -Plays a musical tone
  11941.                 Win:Attr("Foreground/Background") -Changes screen colors
  11942.  
  11943.               You are encouraged to change this program around to change the
  11944.               music and the colors.  For instance make the music higher or
  11945.               lower, faster or slower, and make the colors follow the
  11946.               rainbow instead of being random.  (We wasted 18 lines just on
  11947.               this message . . .  only 20 lines to go!)
  11948.  
  11949.               You could spend hours here, making Beautiful Music!
  11950.  
  11951.             If (Response==Ok)
  11952.               Win:Add ("Beautiful Music", 2, 3, 22, 75, Here)
  11953.               Win:Msg ("Press any key for relief . . .")
  11954.               While (Kbd:Hit()==0) | Do until they give up
  11955.                 ++Row                   | Next row
  11956.                 If (Row > Win:Ptr->Len) | If too low
  11957.              Row=1                 |   back to row 1
  11958.                 For (Col = 0 thru 4)    | Display B Music 5 times
  11959.              Forg=Num:Rand(0,15)
  11960.              Back=Num:Rand(0,15)
  11961.              Move:To(Row,(Col*15+1))
  11962.              Win:Attr(Forg+"/"+Back)
  11963.              Str:Put("Beautiful Music")
  11964.                 Time=Num:Btw(Time*Num:Rand(-4,4),1,8)
  11965.                 Tone=Tone+((Tone/12)*Num:Rand(-2,2))
  11966.                 If (Tone<60 Or Tone > 1400)
  11967.              Tone=440
  11968.                 Jorf:Sound(Tone,Time*40)
  11969.             Return (Ok)
  11970.  
  11971.  
  11972.  
  11973.  
  11974.  
  11975.  
  11976.  
  11977.  
  11978.  
  11979.  
  11980.           Chapter Five - JORF Functions                                 189
  11981.  
  11982.  
  11983.  
  11984.  
  11985.  
  11986.  
  11987.  
  11988.  
  11989.                                      Jorf:System
  11990.  
  11991.  
  11992.           Function  Jorf:System ( Command, Flags, Message ) 
  11993.  
  11994.           Purpose   Execute DOS shell or DOS command.
  11995.  
  11996.           Returns   Ok if executed, Null if not.
  11997.  
  11998.           See Also  Jorf:Exit.
  11999.  
  12000.           Notes     This command allows you to execute any DOS command or
  12001.                     run other programs in a DOS shell.  
  12002.  
  12003.                     If Command is not used or is Null then the operator
  12004.                     will be transferred to an operating system shell and
  12005.                     must type EXIT to return to JORF.
  12006.  
  12007.                     The Flags is a string of letters with any of these
  12008.                     values:
  12009.  
  12010.                     "C"  DOS Only  Clear screen when shelling out.
  12011.                     "P"  DOS/Windows    Pause message before returning
  12012.                     "W"  Windows Only   Spawn a Windows executable and
  12013.                                         return immediately.
  12014.  
  12015.                     More flags are anticipated.
  12016.  
  12017.                     The Message will be printed on the screen before the
  12018.                     DOS command is executed.  It should only be used when
  12019.                     the "C" flag is indicated to clear the screen.  The
  12020.                     message is assumed to be something useful like 'Type
  12021.                     "Exit" to RETURN'.  The Message is ignored if you use
  12022.                     the "W" flag.
  12023.            
  12024.                     DOS 
  12025.                     Version        You will only have about 200K memory for
  12026.                                    your DOS command.  This is too small to
  12027.                                    run most application programs, but is
  12028.                                    just fine to run DOS utility programs
  12029.                                    like Format, Copy and Undelete.
  12030.  
  12031.  
  12032.                     Windows
  12033.                     Version        There are two variations to this
  12034.                                    command.  If you want to launch a
  12035.                                    Windows program, include the "W" flag. 
  12036.                                    The program will launch the program and
  12037.                                    return control back to the originating
  12038.                                    program.  If you want to run a DOS
  12039.                                    command, do not use the "W" flag and the
  12040.  
  12041.           The JORF Manual (Shareware Disk Version)                      190
  12042.  
  12043.  
  12044.  
  12045.  
  12046.  
  12047.  
  12048.  
  12049.                                    DOS command will be run as in the DOS
  12050.                                    version.
  12051.  
  12052.                          When running without the "W" flag, a small batch
  12053.                          file called JSYSTEM.BAT will be created
  12054.                          (JSYS9999.BAT on multiuser systems where 9999 is a
  12055.                          random number).  This file is responsible for
  12056.                          handling the "P" flag and Message parameter.  JORF
  12057.                          will shell into your command using the DOS
  12058.                          COMMAND.COM interpreter.
  12059.  
  12060.                          When running without the "W" flag the size of the
  12061.                          window is controlled by a PIF file.  You can
  12062.                          change the defaults by creating a PIF file called
  12063.                          COMMAND.PIF that controls the COMMAND.COM program. 
  12064.                          If you do this and turn "Full Screen" off, then
  12065.                          your system commands will be windowed.  Under
  12066.                          Windows 3.1 you can also set the Font and size of
  12067.                          the window.
  12068.  
  12069.                     To obtain as much memory as possible, the system
  12070.                     automatically calls Jorf:Flush before executing this
  12071.                     call.  Also, all files are closed before executing the
  12072.                     shell.
  12073.  
  12074.           Example   This program came from a user (with a bug).  Now that
  12075.                     the bug is fixed the program is kinda fun.  DOS.J.
  12076.  
  12077.  
  12078.  
  12079.  
  12080.  
  12081.  
  12082.  
  12083.  
  12084.  
  12085.  
  12086.  
  12087.  
  12088.  
  12089.           Dos:Start
  12090.             Win:Add("Jo's DOS Function Utility", 0, 0, 20, 44)
  12091.              This program allows the user to &
  12092.              select special DOS commands.
  12093.  
  12094.              Place your mouse over the desired &
  12095.              selection and click the Left Mouse &
  12096.              Button or you may use the up and down &
  12097.              arrow keys to select the desired command.
  12098.  
  12099.              {Group:"DOS Commands" Row:9 Col:5 Len:10 Wid:30}
  12100.               {Prompt:"&Memory Stats     " Row:11 Col:7 Wid:25 Action:"Dos:Cmd('Mem')"}
  12101.  
  12102.           Chapter Five - JORF Functions                                 191
  12103.  
  12104.  
  12105.  
  12106.  
  12107.  
  12108.  
  12109.  
  12110.               {Prompt:"&Command Shell    " Row:12 Col:7 Wid:25 Action:"Dos:Cmd('Shell')"}
  12111.               {Prompt:"Directory by &Date" Row:13 Col:7 Wid:25 Action:"Dos:Cmd('DirDate')"}
  12112.               {Prompt:"Directory by &Size" Row:14 Col:7 Wid:25 Action:"Dos:Cmd('DirSize')"}
  12113.               {Prompt:"&Type in a Command" Row:15 Col:7 Wid:25 Action:"Dos:Cmd('TypeIt')"}
  12114.               {Prompt:"&Windows Program  " Row:16 Col:7 Wid:25 Action:"Dos:Cmd('Windows')"}
  12115.               {Prompt:"E&xit             " Row:18 Col:7 Wid:25 Action:"Return(Null)"}
  12116.             Return (Ok)
  12117.  
  12118.           Dos:Cmd(Action)
  12119.             New (Command, Flags, Message)
  12120.             Switch (Action)
  12121.               Case 'Mem'
  12122.                 Command = "Mem /c | More"
  12123.                 Flags = "CP"
  12124.               Case 'Shell'
  12125.                 Command = Null
  12126.                 Flags = "C"
  12127.                 Message = "Type 'EXIT' to return to JORF"
  12128.               Case 'DirDate'
  12129.                 Command = "Dir /o-d | More"
  12130.                 Flags = "CP"
  12131.                 Message = "Sorting . . ."
  12132.               Case 'DirSize'
  12133.                 Command = "Dir /o-s | More"
  12134.                 Flags = "CP"
  12135.                 Message = "Sorting . . ."
  12136.               Case 'TypeIt'
  12137.                 Win:Add
  12138.                   Input:"Command to execute:", Field:"Command"
  12139.                 If (Kbd:Got=='Esc_Key')
  12140.                   Return
  12141.                 Flags = "C"
  12142.               Case 'Windows'
  12143.                 If (Jorf:Info("Windows")==False)
  12144.                   Msg:Add
  12145.                     This option only works in the &
  12146.                     Windows version of the JORF interpreter.
  12147.                   Return
  12148.                 Win:Add
  12149.                   Input:"Windows program:", Field:"Command"
  12150.                 If (Kbd:Got=='Esc_Key')
  12151.                   Return
  12152.                 Flags = "W"
  12153.               Else
  12154.                 Msg:Add
  12155.                   Illegal DOS Command "{Action}".
  12156.                 Return (Ok)
  12157.             Jorf:System (Command, Flags, Message)
  12158.             Return (Ok)
  12159.  
  12160.  
  12161.  
  12162.  
  12163.           The JORF Manual (Shareware Disk Version)                      192
  12164.  
  12165.  
  12166.  
  12167.  
  12168.  
  12169.  
  12170.  
  12171.  
  12172.                                      Jorf:Unlock
  12173.  
  12174.  
  12175.           Function  Jorf:Unlock( Structure ) 
  12176.  
  12177.           Purpose   Unlocks a record, reports locked status. 
  12178.  
  12179.           Returns   Null if record is not locked, OK if properly unlocked..
  12180.  
  12181.           See Also  Jorf:Lock, Jorf:Write.
  12182.  
  12183.           Notes     The Structure is a JORF language structure that is used
  12184.                     to hold fields to be stored to the disk.  This function
  12185.                     works with Jorf:Lock and Jorf:Write to enable you to do
  12186.                     record level locking.  
  12187.  
  12188.                     This function is used primarily to unlock and restore
  12189.                     the value because the operator decided not to change
  12190.                     the record.  If you want to store changes, you should
  12191.                     use Jorf:Write to unlock the record.   When you use
  12192.                     Jorf:Unlock, the structure is automatically re-read
  12193.                     from disk and any changes will be lost.
  12194.  
  12195.                     If you do not have "Multiuser=Yes" set in your JORF.INI
  12196.                     or JORFWIN.INI file then this function has no effect.
  12197.  
  12198.  
  12199.  
  12200.  
  12201.  
  12202.  
  12203.  
  12204.  
  12205.  
  12206.  
  12207.  
  12208.  
  12209.  
  12210.  
  12211.  
  12212.  
  12213.  
  12214.  
  12215.  
  12216.  
  12217.  
  12218.  
  12219.  
  12220.  
  12221.  
  12222.  
  12223.  
  12224.           Chapter Five - JORF Functions                                 193
  12225.  
  12226.  
  12227.  
  12228.  
  12229.  
  12230.  
  12231.  
  12232.  
  12233.                                       Jorf:Write
  12234.  
  12235.  
  12236.           Function  Jorf:Write ( Item ) 
  12237.  
  12238.           Purpose   Write an item to current Data file. 
  12239.  
  12240.           Returns   None.
  12241.  
  12242.           See Also  Jorf:Del.
  12243.  
  12244.           Notes     Writes Item to the current project file.  This function
  12245.                     permanizes a structure so that it can be recalled
  12246.                     later.  It is used:
  12247.  
  12248.                          1. To write a structure as a record, with index
  12249.                          references in the current project file.
  12250.  
  12251.                          2. When you want to insure a text or array value
  12252.                          is in the current project file.
  12253.  
  12254.                          3.  When you have an empty new variable that may
  12255.                          soon become an array or a text pointer that you
  12256.                          want written in the current project file.
  12257.  
  12258.                     This command is intimately tied up with the JORF system
  12259.                     of "Object Persistence".  Normally we think of all JORF
  12260.                     variables as memory variables.  Unlike most languages,
  12261.                     however, the JORF Language features automatic movement
  12262.                     of these variables to disk.  When a structure is
  12263.                     written to a disk file, it goes into the current
  12264.                     project file currently declared using Jorf:File. 
  12265.  
  12266.                     When written, all elements of the structure are
  12267.                     rewritten into the same project file.  This is
  12268.                     important:  You cannot write any record that references
  12269.                     information in another file.  If you directly reference
  12270.                     another structure, that other structure is completely
  12271.                     rewritten into the current file.  The only way to
  12272.                     create a "Relational" Link between separate files is to
  12273.                     store a look up value for the secondary file.
  12274.  
  12275.                     Rewriting large Arrays and blocks of text are
  12276.                     especially slow.  If you create a large text in memory,
  12277.                     and the system runs out and flushes the text to disk
  12278.                     temporarily, it will be flushed to the SWAPFILE.JRF
  12279.                     project file.  If after finishing your large text you
  12280.                     attach it to a structure that is to be written to
  12281.                     another file, the entire text will be read from one
  12282.                     file and duplicated in the second file.  Programmers
  12283.                     will note how wasteful and slow this can become. 
  12284.  
  12285.           The JORF Manual (Shareware Disk Version)                      194
  12286.  
  12287.  
  12288.  
  12289.  
  12290.  
  12291.  
  12292.  
  12293.                     Instead, create the first line of text and use
  12294.                     Jorf:Write to write it to the eventual destination
  12295.                     project.  Then add the rest of the lines. If the
  12296.                     interpreter needs to flush memory, the partial text
  12297.                     will be written to the correct location so that time
  12298.                     and disk accesses are saved later.  
  12299.  
  12300.                     This function works with Jorf:Lock to provide record
  12301.                     level locking.  If a locked record is written using
  12302.                     Jorf:Write then the lock is automatically released.
  12303.  
  12304.           Example   I've always enjoyed the Haiku generator.
  12305.  
  12306.  
  12307.  
  12308.  
  12309.  
  12310.  
  12311.  
  12312.  
  12313.  
  12314.  
  12315.  
  12316.  
  12317.  
  12318.  
  12319.  
  12320.  
  12321.  
  12322.  
  12323.  
  12324.  
  12325.  
  12326.  
  12327.  
  12328.  
  12329.  
  12330.  
  12331.  
  12332.  
  12333.  
  12334.  
  12335.  
  12336.  
  12337.  
  12338.  
  12339.  
  12340.  
  12341.  
  12342.  
  12343.  
  12344.  
  12345.  
  12346.           Chapter Five - JORF Functions                                 195
  12347.  
  12348.  
  12349.  
  12350.  
  12351.  
  12352.  
  12353.  
  12354.  
  12355.           Class:Haiku
  12356.             Index:Key     | A "Key" to store this structure
  12357.             Text          | Current Haiku Text
  12358.             Arts          | Sentence articles
  12359.             Adjs          | Adjectives
  12360.             Nouns         | Nouns
  12361.             Verbs         | Verbs
  12362.             Preps         | Preps
  12363.  
  12364.           Haiku:Start
  12365.             New (Haiku:Haiku)
  12366.             Jorf:File ("Haiku", Here)
  12367.             Haiku=Haiku:GetStructure()
  12368.             Haiku:Thinkup(Haiku)
  12369.             Win:Add("Haiku Generator", 4, 15, 10, 50, Here)
  12370.               Menu:"&File"
  12371.                 Menu:"E&xit" Action:"Jorf:Exit"
  12372.               Menu:"&Print"
  12373.                 Action:"Haiku:Print(Haiku)"
  12374.  
  12375.               Group:"" Row:2 Col:5 Len:3 Wid:40   | Group box border
  12376.               Text:"" Field:"Haiku->Text"         | Text to show
  12377.                 Before:"Null"                     | Never any input here
  12378.  
  12379.               Button:"&Generate" Row:8, Col:5 Wid:20 Action:"Haiku:Thinkup(Haiku)"
  12380.               Button:"E&xit"     Row:8, Col:27 Wid:20 Action:"Jorf:Exit()"
  12381.             Return (Ok)
  12382.  
  12383.           Haiku:Array (Text)
  12384.             | This routine loads words into an array.  Double words must be quoted.
  12385.             | The Array is written to the current file (HAIKU.JRF).
  12386.             New (WordCount, Arr, ArrCount, Spaces)
  12387.             Spaces = Str:Ind(Text)                | Indent level
  12388.             While (Text And Spaces <= Str:Ind(Text))
  12389.               For (WordCount = 1 thru Word:Len (Text))    | For each word
  12390.                 ++ArrCount                                | Add word to
  12391.                 Arr[ArrCount]=Word:At (Text, WordCount)   |   word array
  12392.               Text = Text:Next (Text)             | Next line
  12393.             Jorf:Write (Arr)                      | Write to current file
  12394.             Return (Arr)
  12395.  
  12396.           Haiku:Generate (Haiku, Text)
  12397.             New (Spaces, CurWord, Pos)
  12398.             New (NewWord, NewLine, NewText)
  12399.             Spaces = Str:Ind (Text)
  12400.             While (Text And Spaces <= Str:Ind(Text))
  12401.               | Step backwards - so we can switch "A" to "AN" when necessary
  12402.               For (Pos = Word:Len (Text) thru 1 Step -1)
  12403.                 CurWord = Word:At (Text, Pos)
  12404.                 Switch (CurWord)
  12405.                   Case 'Art'
  12406.  
  12407.           The JORF Manual (Shareware Disk Version)                      196
  12408.  
  12409.  
  12410.  
  12411.  
  12412.  
  12413.  
  12414.  
  12415.                     NewWord = Haiku:GetWord (Haiku->Arts)
  12416.                     If NewWord = "a"
  12417.                       If (Str:Aft (NewLine,"aeiou") < 2)
  12418.                         NewWord = "an"
  12419.                   Case 'Noun'
  12420.                     NewWord = Haiku:GetWord (Haiku->Nouns)
  12421.                   Case 'Adj'
  12422.                     NewWord = Haiku:GetWord (Haiku->Adjs)
  12423.                   Case 'Verb'
  12424.                     NewWord = Haiku:GetWord (Haiku->Verbs)
  12425.                   Case 'Prep'
  12426.                     NewWord = Haiku:GetWord (Haiku->Preps)
  12427.                   Else
  12428.                     NewWord = CurWord
  12429.                 If (Pos = 1)
  12430.                   NewWord = To:Caps (NewWord)
  12431.                 NewLine = NewWord + NewLine
  12432.               NewText = Text:Add (NewLine, NewText)
  12433.               NewLine = Null
  12434.               Text = Text:Next (Text)
  12435.             Haiku->Text = NewText
  12436.             Return (Ok)
  12437.  
  12438.           Haiku:GetStructure
  12439.             | Get Haiku structure from file.  If not found in file, generate
  12440.             |  it from the word lists.
  12441.             New (Haiku:Haiku)
  12442.             Haiku = Struct:Find("Haiku","Key",Null)
  12443.             If (Haiku == Null)
  12444.               Haiku->Arts = Haiku:Array()
  12445.                 a the
  12446.               Haiku->Adjs = Haiku:Array()
  12447.                 autumn hidden bitter misty silent empty
  12448.                 dry dark sighing delicate quiet
  12449.                 white cool frigid winter dappled
  12450.                 twilight afternoon crimson wispy azure
  12451.                 blue billowing broken cold damp falling
  12452.                 frosty tawny long late lingering
  12453.                 little morning leafy billowing
  12454.                 still small sparkling cloudy
  12455.                 wandering withered wild black young
  12456.               Haiku->Nouns = Haiku:Array()
  12457.                 waterfall mist breeze moon
  12458.                 rain wind sea morning snow glitter forest
  12459.                 Josephine cloud meadow sun glade bird brook
  12460.                 butterfly tove dew savannah meadow
  12461.                 flower firefly feather grass haze mountain
  12462.                 night goat shade snowflake
  12463.                 silence lily sky shape surf thunder
  12464.                 violet water wildflower wave
  12465.               Haiku->Verbs = Haiku:Array()
  12466.                 drifts "has stopped" blusters blows
  12467.  
  12468.           Chapter Five - JORF Functions                                 197
  12469.  
  12470.  
  12471.  
  12472.  
  12473.  
  12474.  
  12475.  
  12476.                 races "did gimble" stretches
  12477.                 flutters has risen "is drifting" "is trickling"
  12478.                 murmers "is floating" "is wafting"
  12479.               Haiku->Preps = Haiku:Array()
  12480.                 on in beneath over near of
  12481.               Haiku->Key = "Key"
  12482.               Jorf:Write (Haiku)
  12483.             Return (Haiku)
  12484.  
  12485.           Haiku:GetWord (Arr)
  12486.             New (Word, Off)
  12487.             Off = Num:Rand (1, Word:Len (Arr))
  12488.             Word = Arr[Off]
  12489.             Return Word + " "
  12490.  
  12491.           Haiku:Print(Haiku)
  12492.             New (Dest)
  12493.             Dest=Jorf:Printer()
  12494.             If (Dest!=Null)
  12495.               File:Save("JREPORT.LST",Haiku->Text)
  12496.               File:Append("JREPORT.LST")
  12497.               File:Print("JREPORT.LST",Dest,TRUE)
  12498.             Return (Ok)
  12499.  
  12500.           Haiku:Thinkup(Haiku)
  12501.             Switch Num:Rand (1, 4)
  12502.               Case 1
  12503.                 Haiku:Generate (Haiku)
  12504.                   Art Adj Noun . . .
  12505.                   Art noun verb prep art noun
  12506.                   Adj Adj Noun
  12507.               Case 2
  12508.                 Haiku:Generate (Haiku)
  12509.                   Noun Prep Art Noun
  12510.                   Art Adj Noun Prep Art Noun
  12511.                   Adj Noun
  12512.               Case 3
  12513.                 Haiku:Generate (Haiku)
  12514.                   Art Adj Noun
  12515.                   Art Adj Noun
  12516.                   Art Noun Verb
  12517.               Case 4
  12518.                 Haiku:Generate (Haiku)
  12519.                   Art Adj Noun Verb
  12520.                   Art Adj Noun
  12521.                   Prep Art Adj Noun
  12522.             Win:Dsp
  12523.             Return(Ok)
  12524.  
  12525.  
  12526.  
  12527.  
  12528.  
  12529.           The JORF Manual (Shareware Disk Version)                      198
  12530.  
  12531.  
  12532.  
  12533.  
  12534.  
  12535.  
  12536.  
  12537.  
  12538.                                        Kbd:Bye
  12539.  
  12540.  
  12541.           Function  Kbd:Bye
  12542.  
  12543.           Purpose   Clear keyboard stream. 
  12544.  
  12545.           Returns   None.
  12546.  
  12547.           See Also  Kbd:Get.
  12548.  
  12549.           Notes     Kbd:Bye does not read or process the keys, it just gets
  12550.                     rid of them.
  12551.  
  12552.  
  12553.  
  12554.  
  12555.  
  12556.  
  12557.  
  12558.  
  12559.  
  12560.  
  12561.  
  12562.  
  12563.  
  12564.  
  12565.  
  12566.  
  12567.  
  12568.  
  12569.  
  12570.  
  12571.  
  12572.  
  12573.  
  12574.  
  12575.  
  12576.  
  12577.  
  12578.  
  12579.  
  12580.  
  12581.  
  12582.  
  12583.  
  12584.  
  12585.  
  12586.  
  12587.  
  12588.  
  12589.  
  12590.           Chapter Five - JORF Functions                                 199
  12591.  
  12592.  
  12593.  
  12594.  
  12595.  
  12596.  
  12597.  
  12598.  
  12599.                                        Kbd:Get
  12600.  
  12601.  
  12602.           Function  Kbd:Get ( CursorSize ) 
  12603.  
  12604.           Purpose   Get a Keystroke from the Keyboard.
  12605.  
  12606.           Returns   Keystroke value.
  12607.  
  12608.           See Also  Kbd:Hit, Kbd:Got, Kbd:Put, Line:Inp.
  12609.  
  12610.           Notes     Waits until the operator hits a key and returns the
  12611.                     value of that character.  If CursorSize is "None", no
  12612.                     cursor is displayed.  If it is "Little", then the
  12613.                     cursor will be a blinking line, and if it is "Big", the
  12614.                     cursor will be a blinking block.  Only the first letter
  12615.                     is significant.  If it is absent or null, "Little" is
  12616.                     assumed.
  12617.  
  12618.                     The return value is always a string indicating the key
  12619.                     that was hit.  This is a departure from most language
  12620.                     that returns an integer value.   The key values are
  12621.                     outlined in Appendix C.  
  12622.  
  12623.                     The Event System processes keystrokes using Event:Do
  12624.                     Value "Key".  This processing may change the value of
  12625.                     the key, display a message, or move the cursor
  12626.                     location.  It is especially important during field
  12627.                     input and text input to remember that the cursor
  12628.                     location may change during a Key:Get.  
  12629.  
  12630.           Example
  12631.  
  12632.           WhatKey:Start
  12633.             | Sample for: Key:Get, Event:Add
  12634.             New Key
  12635.             Win:Add ("What Key?", 5, 15, 10, 50)
  12636.             Win:Msg ("Press Alt-X to Quit")
  12637.  
  12638.             While (Kbd:Got!="Alt_X_Key")
  12639.               Str:Put ("Press a Key: ")
  12640.               Key = Kbd:Get ("Big")
  12641.               Str:PutLine ('That was the "' + Key + '".')
  12642.             Jorf:Exit
  12643.  
  12644.  
  12645.  
  12646.  
  12647.  
  12648.  
  12649.  
  12650.  
  12651.           The JORF Manual (Shareware Disk Version)                      200
  12652.  
  12653.  
  12654.  
  12655.  
  12656.  
  12657.  
  12658.  
  12659.  
  12660.                                        Kbd:Got
  12661.  
  12662.  
  12663.           Function  Kbd:Got
  12664.  
  12665.           Purpose   Find out what the last Keystroke was. 
  12666.  
  12667.           Returns   Keystroke value.
  12668.  
  12669.           See Also  Kbd:Hit, Kbd:Get, Line:Inp.
  12670.  
  12671.           Notes     Returns the value of the last keystroke.  Always
  12672.                     returns the key value, even if the event system may
  12673.                     have caused Kbd:Get to return a different key value. 
  12674.  
  12675.                     The return value is always a string indicating the key
  12676.                     that was hit.  The key values are outlined in Appendix
  12677.                     C.  
  12678.  
  12679.  
  12680.  
  12681.  
  12682.  
  12683.  
  12684.  
  12685.  
  12686.  
  12687.  
  12688.  
  12689.  
  12690.  
  12691.  
  12692.  
  12693.  
  12694.  
  12695.  
  12696.  
  12697.  
  12698.  
  12699.  
  12700.  
  12701.  
  12702.  
  12703.  
  12704.  
  12705.  
  12706.  
  12707.  
  12708.  
  12709.  
  12710.  
  12711.  
  12712.           Chapter Five - JORF Functions                                 201
  12713.  
  12714.  
  12715.  
  12716.  
  12717.  
  12718.  
  12719.  
  12720.  
  12721.                                        Kbd:Hit
  12722.  
  12723.  
  12724.           Function  Kbd:Hit
  12725.  
  12726.           Purpose   Check to see if a key has been hit.
  12727.  
  12728.           Returns   True if a key has been hit.  Otherwise False.
  12729.  
  12730.           See Also  Kbd:Get.
  12731.  
  12732.           Notes     Kbd:Hit does not read or process the keystroke in any
  12733.                     way.  To find out what key was hit, use Kbd:Get. 
  12734.  
  12735.  
  12736.  
  12737.  
  12738.  
  12739.  
  12740.  
  12741.  
  12742.  
  12743.  
  12744.  
  12745.  
  12746.  
  12747.  
  12748.  
  12749.  
  12750.  
  12751.  
  12752.  
  12753.  
  12754.  
  12755.  
  12756.  
  12757.  
  12758.  
  12759.  
  12760.  
  12761.  
  12762.  
  12763.  
  12764.  
  12765.  
  12766.  
  12767.  
  12768.  
  12769.  
  12770.  
  12771.  
  12772.  
  12773.           The JORF Manual (Shareware Disk Version)                      202
  12774.  
  12775.  
  12776.  
  12777.  
  12778.  
  12779.  
  12780.  
  12781.  
  12782.                                        Kbd:Put
  12783.  
  12784.           Function  Kbd:Put ( Value ) 
  12785.  
  12786.           Purpose   Stuff the keyboard buffer with keys. 
  12787.  
  12788.           Returns   None.
  12789.  
  12790.           See Also  Kbd:Get.
  12791.  
  12792.           Notes     This function allows you to stuff any keys, including
  12793.                     mouse keys, into the input buffer.  There are three
  12794.                     basic formats you can use:
  12795.  
  12796.                          1. An individual keystroke command.
  12797.                          2. A string of characters to stuff.
  12798.                          3. Some text where each line is either 1 or 2.
  12799.  
  12800.                     It is common to mix these two formats.  For instance,
  12801.                     to stuff the keyboard to fill three data entry fields,
  12802.                     you might use the following six commands:
  12803.  
  12804.                          Kbd:Put ("This goes into Field 1")
  12805.                          Kbd:Put ("Tab_Key")
  12806.                          Kbd:Put ("This goes into Field 2")
  12807.                          Kbd:Put ("Tab_Key")
  12808.                          Kbd:Put ("This goes into Field 3")
  12809.                          Kbd:Put ("Enter_Key")
  12810.  
  12811.                     To stuff commands in "Text" format, you can simply
  12812.                     indent them:
  12813.  
  12814.                          Kbd:Put()
  12815.                            This goes into Field 1
  12816.                            Tab_Key
  12817.                            This goes into Field 2
  12818.                            Tab_Key
  12819.                            This goes into Field 3
  12820.                            Enter_Key
  12821.  
  12822.                     Handy note: On a data entry screen, the Home key goes
  12823.                     to the first, and the End key goes to the last button
  12824.                     on the screen.  Use this fact to establish your
  12825.                     referencec to variaous buttons.
  12826.  
  12827.                     After keys are stuffed the JORF language cannot tell
  12828.                     them from keys that are input.  The keyboard handling
  12829.                     system as a dynamically reallocating buffer, that is
  12830.                     limited only by the size of your near memory.  You can
  12831.                     generally stuff more than 1000 keystrokes without
  12832.                     running out of memory. 
  12833.  
  12834.           Chapter Five - JORF Functions                                 203
  12835.  
  12836.  
  12837.  
  12838.  
  12839.  
  12840.  
  12841.  
  12842.  
  12843.                                        Key:Add
  12844.  
  12845.  
  12846.           Function  Key:Add ( RuleStructure ) 
  12847.  
  12848.           Purpose   Add a String Key to the data base.
  12849.  
  12850.           Returns   None.
  12851.  
  12852.           See Also  Rule:Add.
  12853.  
  12854.           Notes     RuleStructure must be a compound structure with the
  12855.                     elements Type, Obj, Str, Ptr, Fnd (found), and KLen
  12856.                     (Key Length).  The last two elements are used by Key
  12857.                     "Find" to get next key in a series.  The elements Att
  12858.                     and Val used by Rule:Find are replaced here by Str.   
  12859.  
  12860.                     Key:Add adds a new string key valued Obj and Str, with
  12861.                     the associated data in Ptr.  Probability cannot be
  12862.                     added as with the Rule:Add function.  The key may be
  12863.                     found again by specifying the correct Obj, and by doing
  12864.                     a partial or whole key search on the Str value.
  12865.  
  12866.  
  12867.  
  12868.  
  12869.  
  12870.  
  12871.  
  12872.  
  12873.  
  12874.  
  12875.  
  12876.  
  12877.  
  12878.  
  12879.  
  12880.  
  12881.  
  12882.  
  12883.  
  12884.  
  12885.  
  12886.  
  12887.  
  12888.  
  12889.  
  12890.  
  12891.  
  12892.  
  12893.  
  12894.  
  12895.           The JORF Manual (Shareware Disk Version)                      204
  12896.  
  12897.  
  12898.  
  12899.  
  12900.  
  12901.  
  12902.  
  12903.  
  12904.                                        Key:Del
  12905.  
  12906.  
  12907.           Function  Key:Del ( RuleStructure ) 
  12908.  
  12909.           Purpose   Deletes an existing string key.
  12910.  
  12911.           Returns   None.  RuleStructure->Fnd will be True if key was found
  12912.                     and deleted.
  12913.  
  12914.           See Also  Key:Find.
  12915.  
  12916.           Notes     Deletes an existing string key.  This command may be
  12917.                     called with a partial key value, in which case it will
  12918.                     delete the first entry by that value.  
  12919.  
  12920.                     After an entry is deleted, you are still able to go the
  12921.                     "next" entry.  
  12922.           Example   See Key:Add.
  12923.  
  12924.  
  12925.  
  12926.  
  12927.  
  12928.  
  12929.  
  12930.  
  12931.  
  12932.  
  12933.  
  12934.  
  12935.  
  12936.  
  12937.  
  12938.  
  12939.  
  12940.  
  12941.  
  12942.  
  12943.  
  12944.  
  12945.  
  12946.  
  12947.  
  12948.  
  12949.  
  12950.  
  12951.  
  12952.  
  12953.  
  12954.  
  12955.  
  12956.           Chapter Five - JORF Functions                                 205
  12957.  
  12958.  
  12959.  
  12960.  
  12961.  
  12962.  
  12963.  
  12964.  
  12965.                                        Key:Find
  12966.  
  12967.  
  12968.           Function  Key:Find ( RuleStructure ) 
  12969.  
  12970.           Purpose   Find a key.
  12971.  
  12972.           Returns   None.
  12973.  
  12974.           See Also  Rule:Find, Key:Next.
  12975.  
  12976.           Notes     In this function, parameters may be empty, in which
  12977.                     case the first matching index entry will be returned. 
  12978.                     Parameters must be empty from left to right, that is,
  12979.                     if Str has a value then Obj also must have a value.  If
  12980.                     a "hole" is left, then nothing will ever be found.
  12981.  
  12982.                     When a key is found, the structure will be filled with
  12983.                     the values of that key and Fnd will be set to True.  If
  12984.                     Key:Next is called with these values set, then the next
  12985.                     key value is returned.  This process may be continued
  12986.                     until the value of the current key does not match the
  12987.                     value of the original partial key.  This length is put
  12988.                     in KLen after every successful search and may be
  12989.                     modified.
  12990.  
  12991.                     Although this process appears quirky, in practice it is
  12992.                     easy and intuitive.  Generally, string keys have a
  12993.                     "type" in Obj.  Commonly, the first key of that type is
  12994.                     searched, and then all subsequent keys displayed since
  12995.                     they have the same type.  When the type changes in the
  12996.                     index, the list has been completed.
  12997.  
  12998.  
  12999.  
  13000.  
  13001.  
  13002.  
  13003.  
  13004.  
  13005.  
  13006.  
  13007.  
  13008.  
  13009.  
  13010.  
  13011.  
  13012.  
  13013.  
  13014.  
  13015.  
  13016.  
  13017.           The JORF Manual (Shareware Disk Version)                      206
  13018.  
  13019.  
  13020.  
  13021.  
  13022.  
  13023.  
  13024.  
  13025.  
  13026.                                        Key:Next
  13027.  
  13028.  
  13029.           Function  Key:Next ( RuleStructure ) 
  13030.  
  13031.           Purpose   Find next key in sequence.
  13032.  
  13033.           Returns   None.
  13034.  
  13035.           See Also  Key:Find.
  13036.  
  13037.           Notes     If RuleStructure->KLen is zero, then this command works
  13038.                     just like KeyFind.  If it is not zero, then the next
  13039.                     key in sequence is returned.  When a key is found, the
  13040.                     structure will be filled with the values of that key
  13041.                     and Fnd will be set to True.  This process may be
  13042.                     continued until the value of the current key does not
  13043.                     match the length specified.  Values for Klen are: 
  13044.  
  13045.                     0    Rules with the same Type match
  13046.                     1    Rules with the same Type+Obj match
  13047.                     2    Rules with the same Type+Obj+(Partial)Str match
  13048.                     3    Rules with the same Type+Obj+Str match
  13049.  
  13050.  
  13051.  
  13052.  
  13053.  
  13054.  
  13055.  
  13056.  
  13057.  
  13058.  
  13059.  
  13060.  
  13061.  
  13062.  
  13063.  
  13064.  
  13065.  
  13066.  
  13067.  
  13068.  
  13069.  
  13070.  
  13071.  
  13072.  
  13073.  
  13074.  
  13075.  
  13076.  
  13077.  
  13078.           Chapter Five - JORF Functions                                 207
  13079.  
  13080.  
  13081.  
  13082.  
  13083.  
  13084.  
  13085.  
  13086.  
  13087.                                        Key:Prev
  13088.  
  13089.  
  13090.           Function  Key:Prev ( RuleStructure ) 
  13091.  
  13092.           Purpose   Find previous index value.
  13093.  
  13094.           Returns   None.
  13095.  
  13096.           See Also  Key:Find, Key:Next.
  13097.  
  13098.           Notes     This function is the opposite of Key:Next.
  13099.  
  13100.  
  13101.  
  13102.  
  13103.  
  13104.  
  13105.  
  13106.  
  13107.  
  13108.  
  13109.  
  13110.  
  13111.  
  13112.  
  13113.  
  13114.  
  13115.  
  13116.  
  13117.  
  13118.  
  13119.  
  13120.  
  13121.  
  13122.  
  13123.  
  13124.  
  13125.  
  13126.  
  13127.  
  13128.  
  13129.  
  13130.  
  13131.  
  13132.  
  13133.  
  13134.  
  13135.  
  13136.  
  13137.  
  13138.  
  13139.           The JORF Manual (Shareware Disk Version)                      208
  13140.  
  13141.  
  13142.  
  13143.  
  13144.  
  13145.  
  13146.  
  13147.  
  13148.                                        Line:Del
  13149.  
  13150.  
  13151.           Function  Line:Del ( Count ) 
  13152.  
  13153.           Purpose   Delete a Count lines of text displayed in an editing
  13154.                     window.
  13155.  
  13156.           Returns   None.
  13157.  
  13158.           See Also  Line:Inp.
  13159.  
  13160.           Notes     Deletes Count lines of text on the input screen and
  13161.                     handles appropriate scrolling functions.  The text must
  13162.                     have been displayed by a legitimate text input routine. 
  13163.                     Placing text on the window "by hand" does not make it
  13164.                     an input structure appropriate for handling with this
  13165.                     function.
  13166.  
  13167.                     Lines will be inserted if Count is negative.  Nothing
  13168.                     will happen if it is zero.  If the cursor is in column
  13169.                     1, then the line will be appended on the previous line. 
  13170.                     The Join ability makes it symmetrical with Line:Ins
  13171.                     which can Split text lines.
  13172.  
  13173.  
  13174.  
  13175.  
  13176.  
  13177.  
  13178.  
  13179.  
  13180.  
  13181.  
  13182.  
  13183.  
  13184.  
  13185.  
  13186.  
  13187.  
  13188.  
  13189.  
  13190.  
  13191.  
  13192.  
  13193.  
  13194.  
  13195.  
  13196.  
  13197.  
  13198.  
  13199.  
  13200.           Chapter Five - JORF Functions                                 209
  13201.  
  13202.  
  13203.  
  13204.  
  13205.  
  13206.  
  13207.  
  13208.  
  13209.                                        Line:Inp
  13210.  
  13211.  
  13212.           Function  Line:Inp ( Field, Row, Column, Length, Width )  
  13213.  
  13214.           Purpose   Input a data entry field or multiple line text.
  13215.  
  13216.           Returns   None..
  13217.  
  13218.           See Also  Line:Out, Text:Add.
  13219.  
  13220.           Notes     This command may now be functionally obsolete, replaced
  13221.                     by the powerful window management Input command. 
  13222.                     Before the Window Manager existed, this was the only
  13223.                     input command available,.  For the moment, it does no
  13224.                     harm to have an extra function that allows you to input
  13225.                     a single item on a data entry screen. 
  13226.  
  13227.                     To Highlight the field before entry, use Line:Out.
  13228.  
  13229.  
  13230.  
  13231.  
  13232.  
  13233.  
  13234.  
  13235.  
  13236.  
  13237.  
  13238.  
  13239.  
  13240.  
  13241.  
  13242.  
  13243.  
  13244.  
  13245.  
  13246.  
  13247.  
  13248.  
  13249.  
  13250.  
  13251.  
  13252.  
  13253.  
  13254.  
  13255.  
  13256.  
  13257.  
  13258.  
  13259.  
  13260.  
  13261.           The JORF Manual (Shareware Disk Version)                      210
  13262.  
  13263.  
  13264.  
  13265.  
  13266.  
  13267.  
  13268.  
  13269.  
  13270.                                        Line:Ins
  13271.  
  13272.  
  13273.           Function  Line:Ins ( Count )  
  13274.  
  13275.           Purpose   Inserts Count lines in current edit window.
  13276.  
  13277.           Returns   None.
  13278.  
  13279.           See Also  Line:Inp, Line:Del.
  13280.  
  13281.           Notes     Inserts Count lines at the current cursor location and
  13282.                     handles appropriate scrolling functions.  Lines will be
  13283.                     deleted if Count is negative.  Nothing will happen if
  13284.                     it is zero.  
  13285.  
  13286.           Example   How about the Ctrl-N method from the editor.
  13287.  
  13288.                     EditKey:Ctrl_N_Key          | Insert Line 
  13289.                       Win:Ptr->Prefix=Null      | ^Q Prefix is now meaningless
  13290.                       EditKey:Changed           | You've ruined it, must show menu
  13291.                       Line:Ins (1)              | Insert one line
  13292.                       EditKey:Message           | And show current pos and status
  13293.  
  13294.  
  13295.  
  13296.  
  13297.  
  13298.  
  13299.  
  13300.  
  13301.  
  13302.  
  13303.  
  13304.  
  13305.  
  13306.  
  13307.  
  13308.  
  13309.  
  13310.  
  13311.  
  13312.  
  13313.  
  13314.  
  13315.  
  13316.  
  13317.  
  13318.  
  13319.  
  13320.  
  13321.  
  13322.           Chapter Five - JORF Functions                                 211
  13323.  
  13324.  
  13325.  
  13326.  
  13327.  
  13328.  
  13329.  
  13330.  
  13331.                                        Line:Out
  13332.  
  13333.  
  13334.           Function  Line:Out ( Field, Row, Column, Length, Width )  
  13335.  
  13336.           Purpose   Output a data entry field or multiple line text.
  13337.  
  13338.           Returns   None.
  13339.  
  13340.           See Also  Line:Inp, Text:Add.
  13341.  
  13342.           Notes     This command may now be functionally obsolete, replaced
  13343.                     by the powerful window management Input command.  For
  13344.                     the moment, it does no harm to have an extra function
  13345.                     that allows you to input a single item on a data entry
  13346.                     screen.  To highlight, call Win:Att to set the
  13347.                     attribute, then this command to display line or field
  13348.                     with that attribute.
  13349.  
  13350.  
  13351.  
  13352.  
  13353.  
  13354.  
  13355.  
  13356.  
  13357.  
  13358.  
  13359.  
  13360.  
  13361.  
  13362.  
  13363.  
  13364.  
  13365.  
  13366.  
  13367.  
  13368.  
  13369.  
  13370.  
  13371.  
  13372.  
  13373.  
  13374.  
  13375.  
  13376.  
  13377.  
  13378.  
  13379.  
  13380.  
  13381.  
  13382.  
  13383.           The JORF Manual (Shareware Disk Version)                      212
  13384.  
  13385.  
  13386.  
  13387.  
  13388.  
  13389.  
  13390.  
  13391.  
  13392.                                        Line:Rel
  13393.  
  13394.  
  13395.           Function  Line:Rel 
  13396.  
  13397.           Purpose   Release input, forcing data to be re-read from the
  13398.                     field. 
  13399.  
  13400.           Returns   None.
  13401.  
  13402.           See Also  Win:Dsp. 
  13403.  
  13404.           Notes     When data entry is done, there is an internal buffer
  13405.                     that temporarily holds the field value.  If a keystroke
  13406.                     function changes that value, this buffer must be
  13407.                     released, so that the value is re-read from the
  13408.                     original field.  This mechanism saves you from worrying
  13409.                     about data displayed on the screen when you change it
  13410.                     underneath. 
  13411.  
  13412.                     Use of this function is rare.  Usually, you use Win:Dsp
  13413.                     to redisplay all fields on the screen when entry is
  13414.                     complete.  
  13415.  
  13416.  
  13417.  
  13418.  
  13419.  
  13420.  
  13421.  
  13422.  
  13423.  
  13424.  
  13425.  
  13426.  
  13427.  
  13428.  
  13429.  
  13430.  
  13431.  
  13432.  
  13433.  
  13434.  
  13435.  
  13436.  
  13437.  
  13438.  
  13439.  
  13440.  
  13441.  
  13442.  
  13443.  
  13444.           Chapter Five - JORF Functions                                 213
  13445.  
  13446.  
  13447.  
  13448.  
  13449.  
  13450.  
  13451.  
  13452.  
  13453.                                        Mem:Ptr
  13454.  
  13455.  
  13456.           Function  Mem:Ptr
  13457.  
  13458.           Purpose   Set or check global values.
  13459.  
  13460.           Returns   None. 
  13461.  
  13462.           Notes     Global variables are values that may be tested and
  13463.                     changed by any method.  They are a key feature of the
  13464.                     BASIC and dBASE languages.  However, I don't like them
  13465.                     one bit, because you can never really depend on them
  13466.                     holding their values as program flow passes in and out
  13467.                     of other people's subsystems.  
  13468.  
  13469.                     The JORF Language has only one true global variable,
  13470.                     Mem:Ptr.  This is a structure of the Jorf class. 
  13471.                     Structures of this class are allowed to have any
  13472.                     element, without any declaration.  As you run your
  13473.                     program, any time you need to save a value, set it
  13474.                     using Mem:Ptr.  Later, you can retrieve it the same
  13475.                     way: 
  13476.  
  13477.                     Mem:Ptr->Test = "Hi Jo"            | Set global value "Test"
  13478.                     Str:PutLine (Mem:Ptr->Test)        | Use global value "Test"
  13479.  
  13480.  
  13481.                     You should avoid using too many global variables. 
  13482.                     Doing so is an indication that your program is
  13483.                     structured poorly and you are making up for it by
  13484.                     kludging around.  Instead, create new class structures
  13485.                     to pass multiple values around your methods. 
  13486.  
  13487.           Example   See Event:Add.
  13488.  
  13489.  
  13490.  
  13491.  
  13492.  
  13493.  
  13494.  
  13495.  
  13496.  
  13497.  
  13498.  
  13499.  
  13500.  
  13501.  
  13502.  
  13503.  
  13504.  
  13505.           The JORF Manual (Shareware Disk Version)                      214
  13506.  
  13507.  
  13508.  
  13509.  
  13510.  
  13511.  
  13512.  
  13513.  
  13514.                                       Method:Add
  13515.  
  13516.  
  13517.           Function  Method:Add ( Text )  
  13518.  
  13519.           Purpose   Write text including indexes used by the interpreter to
  13520.                     call methods. 
  13521.  
  13522.           Returns   None.
  13523.  
  13524.           See Also  Method:Del.
  13525.  
  13526.           Notes     This function differs from Jorf:Add only in that it
  13527.                     looks for a method name on the first line, and if
  13528.                     found, adds the appropriate indexes so the method may
  13529.                     be found again.   Methods are also indexed by
  13530.                     Class:Read and Class:Check.  
  13531.  
  13532.                     This command does something distressing if the method
  13533.                     already exists.  If you are editing an existing method,
  13534.                     there is no problem.  
  13535.                     But if you have created a new copy of an existing
  13536.                     method, Method:Write must resolve this so there is only
  13537.                     one copy.  What it does is to move your current copy to
  13538.                     the location of the existing copy.  Your editing
  13539.                     changes stick, but your pointer Text will be deleted. 
  13540.                     Whenever you use Method:Write, be aware that you may
  13541.                     lose your pointer.
  13542.            
  13543.  
  13544.  
  13545.  
  13546.  
  13547.  
  13548.  
  13549.  
  13550.  
  13551.  
  13552.  
  13553.  
  13554.  
  13555.  
  13556.  
  13557.  
  13558.  
  13559.  
  13560.  
  13561.  
  13562.  
  13563.  
  13564.  
  13565.  
  13566.           Chapter Five - JORF Functions                                 215
  13567.  
  13568.  
  13569.  
  13570.  
  13571.  
  13572.  
  13573.  
  13574.  
  13575.                                       Method:Del
  13576.  
  13577.  
  13578.           Function  Method:Del ( Text ) 
  13579.  
  13580.           Purpose   Delete text including indexes used for calling method.
  13581.  
  13582.           Returns   None.
  13583.  
  13584.           See Also  Jorf:Del.
  13585.  
  13586.           Notes     This function differs from Jorf:Del only in that it
  13587.                     looks for a method name on the first line, and if
  13588.                     found, deletes any index references.  Methods are
  13589.                     indexed automatically by Class:Read and Method:Add. 
  13590.                     There is no harm in passing all text to this command,
  13591.                     it gives no error if the indexes are not found.
  13592.            
  13593.           Example   See Method:Move.
  13594.  
  13595.  
  13596.  
  13597.  
  13598.  
  13599.  
  13600.  
  13601.  
  13602.  
  13603.  
  13604.  
  13605.  
  13606.  
  13607.  
  13608.  
  13609.  
  13610.  
  13611.  
  13612.  
  13613.  
  13614.  
  13615.  
  13616.  
  13617.  
  13618.  
  13619.  
  13620.  
  13621.  
  13622.  
  13623.  
  13624.  
  13625.  
  13626.  
  13627.           The JORF Manual (Shareware Disk Version)                      216
  13628.  
  13629.  
  13630.  
  13631.  
  13632.  
  13633.  
  13634.  
  13635.  
  13636.                                        Msg:Add
  13637.  
  13638.  
  13639.           Function  Msg:Add ( Title, Type, Text )  
  13640.  
  13641.           Purpose   Show a Dialog Box.
  13642.  
  13643.           Returns   True or False.
  13644.  
  13645.           See Also  Win:Add.
  13646.  
  13647.           Notes     Displays one of four preset dialog boxes.  All boxes
  13648.                     have a message in the top section, and one or two
  13649.                     buttons on the bottom.  The four box Types are:
  13650.  
  13651.                          Ok             The Default, one button says Ok.
  13652.                          Yes            A Yes/No box, default is Yes.
  13653.                          No             A Yes/No box, default is No.
  13654.                          Cancel         An Ok/Cancel box, default is Ok.
  13655.  
  13656.                     Message boxes use the "Message" background if it is
  13657.                     defined in the JORF.INI or JORFWIN.INI file (See
  13658.                     Appendix D).   Under Windows, the message system uses a
  13659.                     special dialog box that limits access to other windows. 
  13660.                     To create a message that uses a normal box, use
  13661.                     Win:Add.
  13662.  
  13663.                     Under MS-Windows the message box frame changes
  13664.                     according to whether there is a title.  If there is a
  13665.                     title, the "Dialog box" frame is used, if there is no
  13666.                     title, the "Wire" frame is used.  The reason is simple
  13667.                     and stupid, it seems that Windows won't allow me to
  13668.                     create a non-dialog box with a dialog box frame and a
  13669.                     title.
  13670.  
  13671.           Example   You can quickly try all the message boxes using the
  13672.                     MSGBOXES.J sample program.
  13673.  
  13674.  
  13675.  
  13676.  
  13677.  
  13678.  
  13679.  
  13680.  
  13681.  
  13682.  
  13683.  
  13684.  
  13685.  
  13686.  
  13687.  
  13688.           Chapter Five - JORF Functions                                 217
  13689.  
  13690.  
  13691.  
  13692.  
  13693.  
  13694.  
  13695.  
  13696.  
  13697.                                        Move:By
  13698.  
  13699.  
  13700.           Function  Move:By ( Row, Column ) 
  13701.  
  13702.           Purpose   Move cursor in window.
  13703.  
  13704.           Returns   None.
  13705.  
  13706.           See Also  Move:To.
  13707.  
  13708.           Notes     Works the same as Move:To Row Column except that
  13709.                     movement is relative to the current position.  It is
  13710.                     common to see negative numbers used in this command to
  13711.                     move back one row or column.  
  13712.                     A movement that exceeds window boundaries place the
  13713.                     cursor as far as possible without going over the
  13714.                     boundary.  There is no way to move outside a window.
  13715.  
  13716.  
  13717.  
  13718.  
  13719.  
  13720.  
  13721.  
  13722.  
  13723.  
  13724.  
  13725.  
  13726.  
  13727.  
  13728.  
  13729.  
  13730.  
  13731.  
  13732.  
  13733.  
  13734.  
  13735.  
  13736.  
  13737.  
  13738.  
  13739.  
  13740.  
  13741.  
  13742.  
  13743.  
  13744.  
  13745.  
  13746.  
  13747.  
  13748.  
  13749.           The JORF Manual (Shareware Disk Version)                      218
  13750.  
  13751.  
  13752.  
  13753.  
  13754.  
  13755.  
  13756.  
  13757.  
  13758.                                        Move:To
  13759.  
  13760.  
  13761.           Function  Move:To ( Row, Column ) 
  13762.  
  13763.           Purpose   Move cursor in window.
  13764.  
  13765.           Returns   None.
  13766.  
  13767.           See Also  Move:By.
  13768.  
  13769.           Notes     Moves the present position to Row and Column
  13770.                     coordinates in the current window.  A position that
  13771.                     exceeds window boundaries place the cursor next to the
  13772.                     boundary.  There is no way to position the cursor
  13773.                     outside a window.
  13774.  
  13775.                     Row may be zero, in which case the cursor will not be
  13776.                     moved up or down.  Row may also be negative, in which
  13777.                     case the cursor will be that many lines from the Bottom
  13778.                     of the window.  The top row of a window is Row 1, and
  13779.                     the bottom is WindowPacket->Length.
  13780.  
  13781.                     Column may be zero, in which case the cursor will not
  13782.                     be moved right or left.  Column may also be negative,
  13783.                     in which case the cursor will be that many characters
  13784.                     from the left side of the window.  The leftmost
  13785.                     character is in column 1, and the rightmost is in
  13786.                     column WindowPacket->Width.
  13787.  
  13788.                     A movement that exceeds window boundaries places the
  13789.                     cursor as far as possible without going over the
  13790.                     boundary.  There is no way to move outside the current
  13791.                     window.
  13792.  
  13793.           Example   See Jorf:Sound.
  13794.  
  13795.  
  13796.  
  13797.  
  13798.  
  13799.  
  13800.  
  13801.  
  13802.  
  13803.  
  13804.  
  13805.  
  13806.  
  13807.  
  13808.  
  13809.  
  13810.           Chapter Five - JORF Functions                                 219
  13811.  
  13812.  
  13813.  
  13814.  
  13815.  
  13816.  
  13817.  
  13818.  
  13819.                                          New
  13820.  
  13821.           Function  New ( Variable1, Variable2, Variable3 ) 
  13822.  
  13823.           Purpose   Creates new variables.
  13824.  
  13825.           Returns   None.
  13826.  
  13827.           Notes     Creates a new instance of an object.  This command is
  13828.                     the only way to allocate structures and new records on
  13829.                     disk.  New must be used at the beginning of a method,
  13830.                     before any other commands.  
  13831.  
  13832.                     New variables are automatically deallocated unless: 
  13833.  
  13834.                          They are linked to a rule.
  13835.                          They are linked to a structure, linked to a rule.
  13836.                          They are linked to Mem:Ptr or Win:Ptr.
  13837.                          They are Returned.
  13838.  
  13839.                     You can declare more than one variable, by listing them
  13840.                     one after another.  Variables names may be prefixed by
  13841.                     a class, separated with a colon.  Variables may also
  13842.                     omit the class, implying they belong to the Jorf class. 
  13843.                     Variables of the Jorf class will take on the class of
  13844.                     another value that is assigned to them. 
  13845.  
  13846.  
  13847.  
  13848.  
  13849.  
  13850.  
  13851.  
  13852.  
  13853.  
  13854.  
  13855.  
  13856.  
  13857.  
  13858.  
  13859.  
  13860.  
  13861.  
  13862.  
  13863.  
  13864.  
  13865.  
  13866.  
  13867.  
  13868.  
  13869.  
  13870.  
  13871.           The JORF Manual (Shareware Disk Version)                      220
  13872.  
  13873.  
  13874.  
  13875.  
  13876.  
  13877.  
  13878.  
  13879.  
  13880.           Example   The Quick Demo in the tutorial writes this method:
  13881.  
  13882.           Demo:Start
  13883.             New (Rad, Chk, Inp1, Inp2)
  13884.             Win:Add ("A Real Screen", 4, 8, 14, 50, Here)
  13885.               Menu:"&Help"
  13886.                 Menu:"&Indented Menu Items"
  13887.                   Menu:"&Create Sub Menus"
  13888.                     Menu:"&And Even Deeper"
  13889.                     Menu:"&Sub Menus"
  13890.                   Menu:"(Escape to Exit)"
  13891.                 Menu:"&Jorf Help         F1" Action:"Hotkey:F1_Key"
  13892.                 Menu:"&Time and Date  Alt-T" Action:"HotKey:Alt_t_Key"
  13893.               Radio:" Radio &1" Row:6 Col:8
  13894.                 Check:"Rad==True", Action:"Rad=True"
  13895.               Radio:" Radio &2"
  13896.                 Check:"Rad==False", Action:"Rad=False"
  13897.               ChBox:" Check Box &A" Row:6, Col:26
  13898.                 Check:"Chk==True", Action:"Chk=True"
  13899.               ChBox:" Check Box &B"
  13900.                 Check:"Chk==False", Action:"Chk=False"
  13901.               Input:"&Input 1  " Row:9, Col:8 Field:"Inp1"
  13902.               Input:"I&nput 2  "              Field:"Inp2"
  13903.               Button:"  &Done  "   Row:12, Col:24, Action:"Esc_Key"
  13904.             Return
  13905.  
  13906.  
  13907.  
  13908.  
  13909.  
  13910.  
  13911.  
  13912.  
  13913.  
  13914.  
  13915.  
  13916.  
  13917.  
  13918.  
  13919.  
  13920.  
  13921.  
  13922.  
  13923.  
  13924.  
  13925.  
  13926.  
  13927.  
  13928.  
  13929.  
  13930.  
  13931.  
  13932.           Chapter Five - JORF Functions                                 221
  13933.  
  13934.  
  13935.  
  13936.  
  13937.  
  13938.  
  13939.  
  13940.  
  13941.                                          Null
  13942.  
  13943.  
  13944.           Function  Null
  13945.  
  13946.           Purpose   Returns "Nothing".
  13947.  
  13948.           Returns   "Nothing".
  13949.  
  13950.           See Also  True.
  13951.  
  13952.           Notes     Returns a JORF Pointer to nothing.  This is used like a
  13953.                     0 is used in decimal location.  Sometimes you need
  13954.                     indicate "nothing", but it has to be something to keep
  13955.                     other items aligned. 
  13956.  
  13957.                     This is equivalent to closed quotes ("") or the number
  13958.                     zero.  The JORF Pointers for zero, "" and null are
  13959.                     exactly the same.
  13960.  
  13961.  
  13962.  
  13963.  
  13964.  
  13965.  
  13966.  
  13967.  
  13968.  
  13969.  
  13970.  
  13971.  
  13972.  
  13973.  
  13974.  
  13975.  
  13976.  
  13977.  
  13978.  
  13979.  
  13980.  
  13981.  
  13982.  
  13983.  
  13984.  
  13985.  
  13986.  
  13987.  
  13988.  
  13989.  
  13990.  
  13991.  
  13992.  
  13993.           The JORF Manual (Shareware Disk Version)                      222
  13994.  
  13995.  
  13996.  
  13997.  
  13998.  
  13999.  
  14000.  
  14001.  
  14002.                                        Num:Abs
  14003.  
  14004.  
  14005.           Function  Num:Abs ( Num ) 
  14006.  
  14007.           Purpose   Returns the absolute value of Num.
  14008.  
  14009.           Returns   Num or -Num.
  14010.  
  14011.           See Also  Num:Max, Num:Min.
  14012.  
  14013.           Notes     The Absolute value is the same number, but always
  14014.                     positive.  So the absolute value of -5 is five, which
  14015.                     is also the absolute value of 5.  This function is used
  14016.                     to insure that negative numbers are treated like their
  14017.                     positive equivalent.
  14018.  
  14019.                     This function maintains the internal type of the
  14020.                     number.  If the number is a floating point number, a
  14021.                     floating point number is returned.  If it is an
  14022.                     integer, an integer is returned.  If it is a string or
  14023.                     text, then the string is converted to a number, and a
  14024.                     floating point or integer value is returned.
  14025.  
  14026.  
  14027.  
  14028.  
  14029.  
  14030.  
  14031.  
  14032.  
  14033.  
  14034.  
  14035.  
  14036.  
  14037.  
  14038.  
  14039.  
  14040.  
  14041.  
  14042.  
  14043.  
  14044.  
  14045.  
  14046.  
  14047.  
  14048.  
  14049.  
  14050.  
  14051.  
  14052.  
  14053.  
  14054.           Chapter Five - JORF Functions                                 223
  14055.  
  14056.  
  14057.  
  14058.  
  14059.  
  14060.  
  14061.  
  14062.  
  14063.                                        Num:Btw
  14064.  
  14065.  
  14066.           Function  Num:Btw ( Num, A, B ) 
  14067.  
  14068.           Purpose   Returns Num between A and B.
  14069.  
  14070.           Returns   Num, A or B.
  14071.  
  14072.           See Also  Num:Max, Num:Min.
  14073.  
  14074.           Notes     Num is between, then the return value is Num.  If it is
  14075.                     lower than A, then A is returned.  If higher than B
  14076.                     then B is returned.  
  14077.  
  14078.                     This function is used to qualify that a value is within
  14079.                     a specific range.  
  14080.  
  14081.  
  14082.  
  14083.  
  14084.  
  14085.  
  14086.  
  14087.  
  14088.  
  14089.  
  14090.  
  14091.  
  14092.  
  14093.  
  14094.  
  14095.  
  14096.  
  14097.  
  14098.  
  14099.  
  14100.  
  14101.  
  14102.  
  14103.  
  14104.  
  14105.  
  14106.  
  14107.  
  14108.  
  14109.  
  14110.  
  14111.  
  14112.  
  14113.  
  14114.  
  14115.           The JORF Manual (Shareware Disk Version)                      224
  14116.  
  14117.  
  14118.  
  14119.  
  14120.  
  14121.  
  14122.  
  14123.  
  14124.                                        Num:Exp
  14125.  
  14126.  
  14127.           Function  Num:Exp ( Num ) 
  14128.  
  14129.           Purpose   Returns the exponential e to Num.
  14130.  
  14131.           Returns   Exponential e to Num.
  14132.  
  14133.           See Also   Num:Log.
  14134.  
  14135.           Notes     Frankly I don't really understand what this is except
  14136.                     that e is a complex number that shows up in some math
  14137.                     algorithms.  Mine is not to question why, but to give
  14138.                     you the capability.  
  14139.  
  14140.  
  14141.  
  14142.  
  14143.  
  14144.  
  14145.  
  14146.  
  14147.  
  14148.  
  14149.  
  14150.  
  14151.  
  14152.  
  14153.  
  14154.  
  14155.  
  14156.  
  14157.  
  14158.  
  14159.  
  14160.  
  14161.  
  14162.  
  14163.  
  14164.  
  14165.  
  14166.  
  14167.  
  14168.  
  14169.  
  14170.  
  14171.  
  14172.  
  14173.  
  14174.  
  14175.  
  14176.           Chapter Five - JORF Functions                                 225
  14177.  
  14178.  
  14179.  
  14180.  
  14181.  
  14182.  
  14183.  
  14184.  
  14185.                                        Num:Log
  14186.  
  14187.           Function  Num:Log ( Num ) 
  14188.  
  14189.           Purpose   Returns the natural logarithm of Num.
  14190.  
  14191.           Returns   The natural logarithm of Num.
  14192.  
  14193.           See Also  Num:Sqrt, Num:Pow.
  14194.  
  14195.           Notes     The logarithm is another mathematical concept I don't
  14196.                     fully understand, but it was what one of Babbage's
  14197.                     great machines was to calculate so it must be
  14198.                     important.  
  14199.  
  14200.           Example   To calculate loan payment quickly, logarithms saves
  14201.                     doing an iterative analysis. See PAYMENT.J
  14202.  
  14203.  
  14204.  
  14205.  
  14206.  
  14207.  
  14208.  
  14209.  
  14210.  
  14211.  
  14212.  
  14213.  
  14214.  
  14215.  
  14216.  
  14217.  
  14218.  
  14219.  
  14220.  
  14221.  
  14222.  
  14223.  
  14224.  
  14225.  
  14226.  
  14227.  
  14228.  
  14229.  
  14230.  
  14231.  
  14232.  
  14233.  
  14234.  
  14235.  
  14236.  
  14237.           The JORF Manual (Shareware Disk Version)                      226
  14238.  
  14239.  
  14240.  
  14241.  
  14242.  
  14243.  
  14244.  
  14245.  
  14246.                                        Num:Max
  14247.  
  14248.  
  14249.           Function  Num:Max ( A, B ) 
  14250.  
  14251.           Purpose   Returns the higher of A and B.
  14252.  
  14253.           Returns   Either A or B.
  14254.  
  14255.           See Also  Num:Btw, Num:Min.
  14256.  
  14257.           Notes     Corresponds to a common C language macro MAX(A,B).  Use
  14258.                     this command to return the Highest of two values.  
  14259.  
  14260.                     There is an odd paradox that you commonly use these
  14261.                     numbers to insure a minimum value.  For instance, to
  14262.                     produce a number no lower than 10, you call Num:Max
  14263.                     Number, 10.
  14264.  
  14265.  
  14266.  
  14267.  
  14268.  
  14269.  
  14270.  
  14271.  
  14272.  
  14273.  
  14274.  
  14275.  
  14276.  
  14277.  
  14278.  
  14279.  
  14280.  
  14281.  
  14282.  
  14283.  
  14284.  
  14285.  
  14286.  
  14287.  
  14288.  
  14289.  
  14290.  
  14291.  
  14292.  
  14293.  
  14294.  
  14295.  
  14296.  
  14297.  
  14298.           Chapter Five - JORF Functions                                 227
  14299.  
  14300.  
  14301.  
  14302.  
  14303.  
  14304.  
  14305.  
  14306.  
  14307.                                        Num:Min
  14308.  
  14309.  
  14310.           Function  Num:Min ( A, B ) 
  14311.  
  14312.           Purpose   Returns the lower of A and B.
  14313.  
  14314.           Returns   Either A or B.
  14315.  
  14316.           See Also  Num:Btw, Num:Max.
  14317.  
  14318.           Notes     Corresponds to a common C language macro MIN(A,B). Use
  14319.                     this command to return the Highest of two values.  
  14320.  
  14321.                     There is an odd paradox that you commonly use these
  14322.                     numbers to insure a maximum value.  For instance, to
  14323.                     produce a number no higher than 10, you call Num:Min
  14324.                     (Number, 10).
  14325.  
  14326.  
  14327.  
  14328.  
  14329.  
  14330.  
  14331.  
  14332.  
  14333.  
  14334.  
  14335.  
  14336.  
  14337.  
  14338.  
  14339.  
  14340.  
  14341.  
  14342.  
  14343.  
  14344.  
  14345.  
  14346.  
  14347.  
  14348.  
  14349.  
  14350.  
  14351.  
  14352.  
  14353.  
  14354.  
  14355.  
  14356.  
  14357.  
  14358.  
  14359.           The JORF Manual (Shareware Disk Version)                      228
  14360.  
  14361.  
  14362.  
  14363.  
  14364.  
  14365.  
  14366.  
  14367.  
  14368.                                        Num:Pow
  14369.  
  14370.  
  14371.           Function  Num:Pow ( Num, Pow ) 
  14372.  
  14373.           Purpose   Returns Num  raised to the Pow power.
  14374.  
  14375.           Returns   Power of Num.
  14376.  
  14377.           See Also  Num:Sqrt.
  14378.  
  14379.           Notes     Returns Num raised to the indicated power.  The result
  14380.                     is an integer only if it fits, and is a floating point
  14381.                     if it is fractional or very large.
  14382.  
  14383.           Example   See Num:Log
  14384.  
  14385.  
  14386.  
  14387.  
  14388.  
  14389.  
  14390.  
  14391.  
  14392.  
  14393.  
  14394.  
  14395.  
  14396.  
  14397.  
  14398.  
  14399.  
  14400.  
  14401.  
  14402.  
  14403.  
  14404.  
  14405.  
  14406.  
  14407.  
  14408.  
  14409.  
  14410.  
  14411.  
  14412.  
  14413.  
  14414.  
  14415.  
  14416.  
  14417.  
  14418.  
  14419.  
  14420.           Chapter Five - JORF Functions                                 229
  14421.  
  14422.  
  14423.  
  14424.  
  14425.  
  14426.  
  14427.  
  14428.  
  14429.                                        Num:Rand
  14430.  
  14431.  
  14432.           Function  Num:Rand ( Low, High ) 
  14433.  
  14434.           Purpose   Produces a Random Number.
  14435.  
  14436.           Returns   A Random Number from Low through High.
  14437.  
  14438.           Notes     Produces a pseudo random number between High and Low
  14439.                     that are assumed to be integer values.  The random
  14440.                     number seed is the system clock and will be different
  14441.                     for each run of JORF.  The number may be Low or High or
  14442.                     any integer value between. 
  14443.  
  14444.           Example   The MANTRA.J sample program uses random row and column
  14445.                     for placing windows.
  14446.  
  14447.           Mantra:Start
  14448.             New (Counter)
  14449.             Msg:Add("Mantra")
  14450.               This next sample programs will display some windows &
  14451.               and get some keyboard entry.  One of my pet projects &
  14452.               is making computers say Mantras, and idea proposed by &
  14453.               Edsger Dijkstra many years ago.
  14454.  
  14455.               Tibetan Buddhists use mechanical prayer &
  14456.               wheels to pray more quickly and efficiently. &
  14457.               Japanese Buddhists of the Amida sect believe &
  14458.               that anyone who says "Amida" with pure &
  14459.               heart will go to heaven, so they say it as many times as possible &
  14460.               in hopes of forgetting and saying it with pure heart once in their lives.
  14461.  
  14462.               This Mantra system combines these ideas just in case they &
  14463.               may be right.  Who can have purer heart than a &
  14464.               computer?  If you run a Mantra system often, perhaps &
  14465.               your computer will also forget and therefore insure your place in heaven.
  14466.             While (Kbd:Hit==False)
  14467.               While (Counter < 40 And Kbd:Hit==False)
  14468.                 Mantra:Show(Here)
  14469.                 ++Counter
  14470.               While (Counter > 0 And Kbd:Hit==False)
  14471.                 Win:Del
  14472.                 --Counter
  14473.             Kbd:Bye
  14474.             Return
  14475.  
  14476.           Mantra:Show (Level)
  14477.             New (Row,Col)
  14478.             Row = Num:Rand(2,10)
  14479.             Col = Num:Rand(2,60)
  14480.  
  14481.           The JORF Manual (Shareware Disk Version)                      230
  14482.  
  14483.  
  14484.  
  14485.  
  14486.  
  14487.  
  14488.  
  14489.             Win:Add ("Om",Row,Col,0,0,Level)
  14490.               Am I a butterfly that
  14491.               dreams I am a computer?
  14492.  
  14493.               Or am I a computer that
  14494.               dreams I am a Butterfly?
  14495.             Return(Ok)
  14496.  
  14497.  
  14498.  
  14499.  
  14500.  
  14501.  
  14502.  
  14503.  
  14504.  
  14505.  
  14506.  
  14507.  
  14508.  
  14509.  
  14510.  
  14511.  
  14512.  
  14513.  
  14514.  
  14515.  
  14516.  
  14517.  
  14518.  
  14519.  
  14520.  
  14521.  
  14522.  
  14523.  
  14524.  
  14525.  
  14526.  
  14527.  
  14528.  
  14529.  
  14530.  
  14531.  
  14532.  
  14533.  
  14534.  
  14535.  
  14536.  
  14537.  
  14538.  
  14539.  
  14540.  
  14541.  
  14542.           Chapter Five - JORF Functions                                 231
  14543.  
  14544.  
  14545.  
  14546.  
  14547.  
  14548.  
  14549.  
  14550.  
  14551.                                        Num:Sqrt
  14552.  
  14553.  
  14554.           Function  Num:Sqrt ( Num ) 
  14555.  
  14556.           Purpose   Returns the square root of Num.
  14557.  
  14558.           Returns   Square root of Num.
  14559.  
  14560.           See Also  Num:Pow.
  14561.  
  14562.           Notes     Returns the square root of Num.  The return value is an
  14563.                     integer only if it fits.  If it is fractional, it is a
  14564.                     floating point value.  The square root of zero is
  14565.                     returned as zero.
  14566.  
  14567.  
  14568.  
  14569.  
  14570.  
  14571.  
  14572.  
  14573.  
  14574.  
  14575.  
  14576.  
  14577.  
  14578.  
  14579.  
  14580.  
  14581.  
  14582.  
  14583.  
  14584.  
  14585.  
  14586.  
  14587.  
  14588.  
  14589.  
  14590.  
  14591.  
  14592.  
  14593.  
  14594.  
  14595.  
  14596.  
  14597.  
  14598.  
  14599.  
  14600.  
  14601.  
  14602.  
  14603.           The JORF Manual (Shareware Disk Version)                      232
  14604.  
  14605.  
  14606.  
  14607.  
  14608.  
  14609.  
  14610.  
  14611.  
  14612.                                        Num:Str
  14613.  
  14614.  
  14615.           Function  Num:Str ( Number, Format, Base, Width )  
  14616.  
  14617.           Purpose   Convert number to a formatted string.
  14618.  
  14619.           Returns   Returns the formatted string.
  14620.  
  14621.           See Also  To:Num.
  14622.  
  14623.           Notes     Converts and formats a number making it a string.  This
  14624.                     is the  opposite of To:Num.  
  14625.  
  14626.                     You can use the Base to change the number base of the
  14627.                     conversion.  The default is 10 for decimal.  You can 16
  14628.                     for hexadecimal, 8 for octal, or any other number for
  14629.                     other numbering bases.
  14630.  
  14631.                     You can use the Format to apply a format to the number. 
  14632.                     The formatter is a string with a mask for the number. 
  14633.                     Available digits in the string are:
  14634.  
  14635.                     #    Writes a numeric digit
  14636.                     0    Writes 0 place holder or the numeric digit
  14637.                     -    Writes a - sign if number is negative
  14638.                     +    Writes a + sign if positive, - if negative
  14639.                     .    Decimal point
  14640.                     ,    Commas will be printed in the locations specified.
  14641.                     :    Any other character will be printed as is.
  14642.  
  14643.                     If you specify a width, the returned number will be
  14644.                     right justified with spaces to the specified width. 
  14645.                     This is useful for formatting a number in reports, and
  14646.                     is used by the Window management system for on-screen
  14647.                     formatting of numbers.
  14648.  
  14649.                     Some examples of formatters:
  14650.  
  14651.                     Number              Formatter Result
  14652.                     1234567.89     "#,###,##0.00" "1,234,567,89"
  14653.                     0              "#,###,##0.00" "0.00"
  14654.                     0              "#,###,###"    Null
  14655.                     1234           "00:00"        "12:34"
  14656.  
  14657.  
  14658.  
  14659.           Example   The Binary.J sample program formats numbers in base 2.
  14660.  
  14661.           Binary:Start
  14662.             New Char
  14663.  
  14664.           Chapter Five - JORF Functions                                 233
  14665.  
  14666.  
  14667.  
  14668.  
  14669.  
  14670.  
  14671.  
  14672.             Win:Add ("BINARY VALUES", 4, 4, 19, 60, Here)
  14673.  
  14674.             For (Char = 0 Thru 255)
  14675.               If (Char > 0 and (Char % 16 == 0))
  14676.                 Win:Pause
  14677.                 If Key:Got == "Esc_Key"
  14678.              Break
  14679.               Str:Put("     Character= {To:Str(Char,'000')} Symbol= ")
  14680.               Char:Put(Char)
  14681.               Str:PutLine("     Binary= {To:Str(Char,'0000 0000',2)}")
  14682.  
  14683.             If Key:Got != "Esc_Key"
  14684.               Win:Pause
  14685.             Jorf:Exit
  14686.  
  14687.                     The Payment.J sample program uses a number of
  14688.                     formatters to format dollar and percentage amounts.
  14689.  
  14690.           Class:Payment (Amt,Yrs,Intr,Pmt,Pmt50,Yrs50)
  14691.  
  14692.           Payment:Start
  14693.             New (Payment:Pmt)
  14694.             Win:Add ("Loan Payment Calculator",5,20)
  14695.               String:"Calculate your loan payment amount and years"
  14696.               String:"to pay if you added just $50 to the payment."
  14697.               String:
  14698.               String:"Press the TAB key to get from one field to"
  14699.               String:"the next. ENTER will end the program."
  14700.  
  14701.               Input:"&Loan Amount         ", Row:7 Col:5 Wid:14
  14702.                 Field:"Pmt->Amt", After:"Payment:Calc(Pmt)"
  14703.                 Format:"###,###,###.00", Type:"Numeric"
  14704.  
  14705.               Input:"&Years to Pay        ", Row:8 Col:5 Wid:3
  14706.                 Field:"Pmt->Yrs", After:"Payment:Calc(Pmt)"
  14707.                 Format:"###", Type:"Numeric"
  14708.  
  14709.               Input:"&Percent Interest    ", Row:9 Col:5 Wid:8
  14710.                 Field:"Pmt->Intr", After:"Payment:Calc(Pmt)"
  14711.                 Format:"00.0000%", Type:"Numeric"
  14712.  
  14713.               Input:"Payment             ", Row:10 Col:5 Wid:14
  14714.                 Field:"Pmt->Pmt", Before:"Return(Null)"
  14715.                 Format:"###,###,###.00", Type:"Numeric"
  14716.  
  14717.               Input:"Adding just $50     ", Row:12 Col:5 Wid:14
  14718.                 Field:"Pmt->Pmt50", Before:"Return(Null)"
  14719.                 Format:"###,###,###.00", Type:"Numeric"
  14720.  
  14721.               Input:"Reduces the years to"  Row:13 Col:5 Wid:3
  14722.                 Field:"Pmt->Yrs50", Before:"Return(Null)"
  14723.                 Format:"###", Type:"Numeric"
  14724.  
  14725.           The JORF Manual (Shareware Disk Version)                      234
  14726.  
  14727.  
  14728.  
  14729.  
  14730.  
  14731.  
  14732.  
  14733.               Button:"    &Done    ", Row:15, Col:16
  14734.             Return(Ok)
  14735.  
  14736.           Payment:Calc(Pmt)
  14737.             New (Periods,Per_Intr,Payment,Months50)
  14738.             Pmt->Pmt = 0
  14739.             If (Pmt->Intr > 0 And Pmt->Yrs > 0)
  14740.               Periods    = Pmt->Yrs*12
  14741.               Per_Intr   = Pmt->Intr/12/100
  14742.               Payment    = (Pmt->Amt*Per_Intr) / (1-Num:Pow(1+Per_Intr,(-Periods)))
  14743.               Payment    = Num:Int((Payment+.005)*100)/100
  14744.               Pmt->Pmt   = Payment
  14745.               Pmt->Pmt50 = Payment+50
  14746.               Months50   = Num:Log(Pmt->Pmt50/(Pmt->Pmt50-Pmt->Amt*Per_Intr))
  14747.               Months50   = Months50/Num:Log(1+Per_Intr)
  14748.               Pmt->Yrs50 = Num:Int((Months50/12)*10)/10
  14749.               Win:Dsp
  14750.             Return (Ok)
  14751.  
  14752.           Special Note   Some countries use a comma-decimal format where
  14753.                          the comma marks the decimal point and a period is
  14754.                          the thousands indicator.  To accommodate these
  14755.                          countries, JORF has an INI file setting to change
  14756.                          the default display format to use the
  14757.                          comma-decimal format.
  14758.  
  14759.                     Even when changed, however, all numeric formatters for
  14760.                     Num:Str must be in the American period-decimal style. 
  14761.                     Also, decimal numbers written in the program must also
  14762.                     be period-decimal style. This allows programs to be
  14763.                     portable, because the code does not need to change to
  14764.                     accommodate users who wish to use the comma-decimal
  14765.                     style.  
  14766.  
  14767.                     For an example of comma-decimal formatting, change your
  14768.                     the Decimal setting in your INI file to "Decimal=,",
  14769.                     then run the Payment.J sample program.  Note that in
  14770.                     the program the number .005 is expressed in
  14771.                     period-decimal format, even though the resulting
  14772.                     calculation is displayed in comma decimal format.
  14773.  
  14774.                     Decimal        Number    Formatter Result
  14775.                     Period         1234.56   "#,##0.00"     "1,234.56"
  14776.                     Comma          1234.56   "#,##0.00"     "1.234,56"
  14777.                     Period         .005 "0.0000"       "0.0050"
  14778.                     Comma          .005 "0.0000"       "0,0050"
  14779.  
  14780.  
  14781.  
  14782.  
  14783.  
  14784.  
  14785.  
  14786.           Chapter Five - JORF Functions                                 235
  14787.  
  14788.  
  14789.  
  14790.  
  14791.  
  14792.  
  14793.  
  14794.  
  14795.                                           Ok
  14796.  
  14797.  
  14798.           Function  Ok
  14799.  
  14800.           Purpose   None.
  14801.  
  14802.           Returns   1 (integer one).
  14803.  
  14804.           See Also  True.
  14805.  
  14806.           Notes     This value allows you create readable "Endless" While
  14807.                     loops by saying While Ok.
  14808.  
  14809.  
  14810.  
  14811.  
  14812.  
  14813.  
  14814.  
  14815.  
  14816.  
  14817.  
  14818.  
  14819.  
  14820.  
  14821.  
  14822.  
  14823.  
  14824.  
  14825.  
  14826.  
  14827.  
  14828.  
  14829.  
  14830.  
  14831.  
  14832.  
  14833.  
  14834.  
  14835.  
  14836.  
  14837.  
  14838.  
  14839.  
  14840.  
  14841.  
  14842.  
  14843.  
  14844.  
  14845.  
  14846.  
  14847.           The JORF Manual (Shareware Disk Version)                      236
  14848.  
  14849.  
  14850.  
  14851.  
  14852.  
  14853.  
  14854.  
  14855.  
  14856.                                        Rep:Add
  14857.  
  14858.  
  14859.           Function  Rep:Add ( Title, Row, Col, Len, Wid, Level, Def )  
  14860.  
  14861.           Purpose   Write a report or document.
  14862.  
  14863.           Returns   None.
  14864.  
  14865.           See Also  File:Print.
  14866.  
  14867.           Notes     The future of this function is bright, but currently it
  14868.                     is but a shadow of what will come.  The job here is to
  14869.                     create a report generating system as easy as the screen
  14870.                     system handled item the Win:Add command.
  14871.  
  14872.                     The parameter Title is used only for the status box
  14873.                     that will shows page and line is currently being
  14874.                     generated.  The parameters Row, Col, Len and Wid help
  14875.                     define the page size.  
  14876.  
  14877.                     The last parameter Def for definition is usually the
  14878.                     report definition in an indented section below this
  14879.                     command.   The  report is always written to the file
  14880.                     JREPORT.LST which then can be printed using File:Print. 
  14881.                      Like Win:Add, there are several key words used to
  14882.                     define report elements.
  14883.  
  14884.                          Header    A page header item
  14885.                          Footer    A page footer item
  14886.                          Next      Method to get the next record
  14887.                          Item      An Item on the report
  14888.                          Text      A multiline text in the report
  14889.  
  14890.                     If the operator presses the Esc_Key while a report is
  14891.                     being generated, the process will be aborted, the file
  14892.                     erased and null returned.  Checking file existence is a
  14893.                     good test of whether the Rep:Add finished normally.
  14894.  
  14895.                     Still to be completed is multiple level processing
  14896.                     (which will be done using indented sections, of course)
  14897.                     and support for printer drivers.  Please contact The
  14898.                     JORF Company for further changes and upgrades to this
  14899.                     command.
  14900.  
  14901.  
  14902.  
  14903.  
  14904.  
  14905.  
  14906.  
  14907.  
  14908.           Chapter Five - JORF Functions                                 237
  14909.  
  14910.  
  14911.  
  14912.  
  14913.  
  14914.  
  14915.  
  14916.  
  14917.           Example   This next example shows a normal report format.  This
  14918.                     report lists contact names one after the other.  It
  14919.                     contains a header and a footer.
  14920.  
  14921.  
  14922.           Contact:List
  14923.                       New (Dest)
  14924.                       Mem:Ptr->IndexName = "FullName"
  14925.                       Time:Get(Mem:Ptr)
  14926.                       Mem:Ptr->Page=1
  14927.  
  14928.                       Dest=Jorf:Printer()
  14929.                       If (Dest)
  14930.                         Win:Add("Printing")
  14931.                           Printing . . .
  14932.                         Contact:SetFile(Here)
  14933.                         Rep:Add ("Contact Listing", 5, 5, 60, 75,Here)
  14934.                           Header:"'Contact Listing Report'"     NewRow:1 Col:30
  14935.                           Header:"'Page '+Mem:Ptr->Page"       NewRow:1 Col:1
  14936.                           Header:"'Date '+Mem:Ptr->SDate"               Col:50
  14937.                           Header:"Str:AtSet(Null,1,'-',80)" NewRow:1 Col:1
  14938.                           Next:"Struct:Next('Contact', 
  14939.                                    Mem:Ptr->IndexName, Mem:Ptr->Contact)"
  14940.                           Item:"Mem:Ptr->Contact->FullName"      NewRow:2 Col:1  Len:20
  14941.                           Item:"Mem:Ptr->Contact->Company "               Col:22 Len:32
  14942.                           Item:"Mem:Ptr->Contact->WorkPhone"              Col:52 Len:28
  14943.                           Item:"Mem:Ptr->Contact->Addr1"         NewRow:1 Col:5  Len:30
  14944.                           Item:"Mem:Ptr->Contact->Addr2"         NewRow:1 Col:5  Len:30
  14945.                           Item:"Mem:Ptr->Contact->Addr3"         NewRow:1 Col:5  Len:30
  14946.                           Item:"Null"                            NewRow:1 Col:5  Len:30
  14947.                           Footer:"'Continued on Page '+Mem:Ptr->Page+1" Row:56 Col:1
  14948.                         File:Print("Jreport.lst",Dest)
  14949.                       Return (Ok)
  14950.  
  14951.  
  14952.  
  14953.  
  14954.  
  14955.  
  14956.  
  14957.  
  14958.  
  14959.  
  14960.  
  14961.  
  14962.  
  14963.  
  14964.  
  14965.  
  14966.  
  14967.  
  14968.  
  14969.           The JORF Manual (Shareware Disk Version)                      238
  14970.  
  14971.  
  14972.  
  14973.  
  14974.  
  14975.  
  14976.  
  14977.  
  14978.                     If you skip the page definition, the report will print
  14979.                     without headers or footers.  You can use this to print
  14980.                     continuous  forms.
  14981.  
  14982.  
  14983.           Contact:ContinLabels(Flag)
  14984.                       New (Dest,CurrContact)
  14985.                       Dest=Jorf:Printer()
  14986.                       Win:Add("Printing")
  14987.                         Printing . . .
  14988.  
  14989.                       Contact:SetFile(Here)
  14990.                       CurrContact        = Mem:Ptr->Contact
  14991.                       Mem:Ptr->OneContact= CurrContact
  14992.                       Mem:Ptr->Contact   = Null
  14993.  
  14994.                       | Report format for Continuous labels, 6 lines,  1 line between
  14995.                       |
  14996.                       Rep:Add ("Continuous Labels")
  14997.                         Next:"Contact:Nextlabel(Flag)"
  14998.                         Item:"'('+Mem:Ptr->Contact->MailCode+')'" NewRow:1 Col:26 Wid:12
  14999.                           Before:"Mem:Ptr->Contact->MailCode!=Null"
  15000.                         Item:"" NewRow:1 Col:26 Wid:12
  15001.                           Before:"Mem:Ptr->Contact->MailCode==Null"
  15002.                         Item:"Mem:Ptr->Contact->FullName"    NewRow:1 Col:1  Wid:40
  15003.                         Item:"Mem:Ptr->Contact->Company"     NewRow:1 Col:1  Wid:40
  15004.                           Before:"Mem:Ptr->Contact->Company!=Null"
  15005.                         Item:"Mem:Ptr->Contact->Addr1"       NewRow:1 Col:1  Wid:40
  15006.                         Item:"Mem:Ptr->Contact->Addr2"       NewRow:1 Col:1  Wid:40
  15007.                         Item:"Mem:Ptr->Contact->Addr3"       NewRow:1 Col:1  Wid:40
  15008.                         Item:"" NewRow:1
  15009.                           Before:"Mem:Ptr->Contact->Company==Null"
  15010.                       File:Print("JREPORT.LST",Dest)
  15011.                       Mem:Ptr->Contact=CurrContact
  15012.                       Return(Null)
  15013.  
  15014.  
  15015.  
  15016.  
  15017.  
  15018.  
  15019.  
  15020.  
  15021.  
  15022.  
  15023.  
  15024.  
  15025.  
  15026.  
  15027.  
  15028.  
  15029.  
  15030.           Chapter Five - JORF Functions                                 239
  15031.  
  15032.  
  15033.  
  15034.  
  15035.  
  15036.  
  15037.  
  15038.  
  15039.                     This last example shows how you can read an ASCII text
  15040.                     file to feed a text item in the report.  The text key
  15041.                     word takes the name of a JORF pointer that holds the
  15042.                     text to use for a format.  Lines in that text may
  15043.                     contain JORF variables in curly braces. 
  15044.  
  15045.                     Contact:MergeLetter
  15046.                       New (Dest,Letter,CurrContact)
  15047.                       Time:Get(Mem:Ptr)
  15048.                       Letter=File:Load(Contact:GetLetter)
  15049.                       If (Letter!=Null)
  15050.                         Dest=Jorf:Printer()
  15051.                         If (Dest)
  15052.                           CurrContact=Mem:Ptr->Contact
  15053.                           Mem:Ptr->Contact=Null
  15054.                           Win:Add("Printing")
  15055.                             Printing . . .
  15056.                           Rep:Add ("Merge Letter", 5, 5, 60, 75,Here)
  15057.                             Header:"" Row:1
  15058.                             Next:"Contact:NextRecord('Next')"
  15059.                             Text:"Letter"
  15060.                           File:Print("JREPORT.LST",Dest)
  15061.                           Mem:Ptr->Contact=CurrContact
  15062.                       Return (Ok)
  15063.  
  15064.  
  15065.  
  15066.  
  15067.  
  15068.  
  15069.  
  15070.  
  15071.  
  15072.  
  15073.  
  15074.  
  15075.  
  15076.  
  15077.  
  15078.  
  15079.  
  15080.  
  15081.  
  15082.  
  15083.  
  15084.  
  15085.  
  15086.  
  15087.  
  15088.  
  15089.  
  15090.  
  15091.           The JORF Manual (Shareware Disk Version)                      240
  15092.  
  15093.  
  15094.  
  15095.  
  15096.  
  15097.  
  15098.  
  15099.  
  15100.                                         Return
  15101.  
  15102.  
  15103.           Function  Return (Value )
  15104.  
  15105.           Purpose   Return a value.
  15106.  
  15107.           Returns   None.
  15108.  
  15109.           Notes     Methods may return a single value using this command. 
  15110.                     If no value is specified, null is returned.  A method
  15111.                     that ends without an explicit Return is the same as
  15112.                     Return (Null).
  15113.  
  15114.                     If more than one value needs to be returned, the
  15115.                     parameters used to call the function may be changed.  
  15116.  
  15117.                     Return may be used at any time, including If statements
  15118.                     and While loops. This will end execution of the current
  15119.                     method and return control to the calling method.
  15120.  
  15121.  
  15122.  
  15123.  
  15124.  
  15125.  
  15126.  
  15127.  
  15128.  
  15129.  
  15130.  
  15131.  
  15132.  
  15133.  
  15134.  
  15135.  
  15136.  
  15137.  
  15138.  
  15139.  
  15140.  
  15141.  
  15142.  
  15143.  
  15144.  
  15145.  
  15146.  
  15147.  
  15148.  
  15149.  
  15150.  
  15151.  
  15152.           Chapter Five - JORF Functions                                 241
  15153.  
  15154.  
  15155.  
  15156.  
  15157.  
  15158.  
  15159.  
  15160.  
  15161.                                        Rule:Add
  15162.  
  15163.  
  15164.           Function  Rule:Add ( RuleStructure )  
  15165.  
  15166.           Purpose   Add a new Rule.
  15167.  
  15168.           Returns   None.
  15169.  
  15170.           See Also  Key:Add.
  15171.  
  15172.           Notes     RuleStructure must be a structure with the elements
  15173.                     Obj, Att, Val, Prob, Ptr, Fnd (Found), and KLen (Key
  15174.                     Length).  The last two elements are used by Rule:Find
  15175.                     to get next rule in a series.  The element Str used by
  15176.                     Key:Find are replaced here by Att and Val.   
  15177.                     Adds rule valued Obj, Att and Val, with the associated
  15178.                     data in Ptr (Pointer).  The rule may be found again by
  15179.                     doing a partial or whole rule search on RuleStructure.
  15180.  
  15181.           Example   The ISA.J source file demonstrates both forward and
  15182.                     backward searching using the Rule system.   It is an
  15183.                     older sample program and so has pretty primitive window
  15184.                     handling.
  15185.  
  15186.  
  15187.  
  15188.  
  15189.  
  15190.  
  15191.  
  15192.  
  15193.  
  15194.  
  15195.  
  15196.  
  15197.  
  15198.  
  15199.  
  15200.  
  15201.  
  15202.  
  15203.  
  15204.  
  15205.  
  15206.  
  15207.  
  15208.  
  15209.  
  15210.  
  15211.  
  15212.  
  15213.           The JORF Manual (Shareware Disk Version)                      242
  15214.  
  15215.  
  15216.  
  15217.  
  15218.  
  15219.  
  15220.  
  15221.  
  15222.                                        Rule:Del
  15223.  
  15224.  
  15225.           Function  Rule:Del ( RuleStructure )  
  15226.  
  15227.           Purpose   Delete a Rule in the Data Base.
  15228.  
  15229.           Returns   None.  Sets RuleStructure->Fnd to True if Rule was
  15230.                     deleted.
  15231.  
  15232.           See Also  Key:Del.
  15233.  
  15234.           Notes     Deletes an existing rule.  This command may be called
  15235.                     with a partial rule, in which case it will delete the
  15236.                     first rule that begins with that value.  It is highly
  15237.                     recommended that this command be called with a complete
  15238.                     rule to insure that the correct entry is deleted.  
  15239.  
  15240.                     After a rule is deleted, you can still use Rule:Next go
  15241.                     the "next" rule.  
  15242.  
  15243.  
  15244.  
  15245.  
  15246.  
  15247.  
  15248.  
  15249.  
  15250.  
  15251.  
  15252.  
  15253.  
  15254.  
  15255.  
  15256.  
  15257.  
  15258.  
  15259.  
  15260.  
  15261.  
  15262.  
  15263.  
  15264.  
  15265.  
  15266.  
  15267.  
  15268.  
  15269.  
  15270.  
  15271.  
  15272.  
  15273.  
  15274.           Chapter Five - JORF Functions                                 243
  15275.  
  15276.  
  15277.  
  15278.  
  15279.  
  15280.  
  15281.  
  15282.  
  15283.                                       Rule:Find
  15284.  
  15285.  
  15286.           Function  Rule:Find ( RuleStructure ) 
  15287.  
  15288.           Purpose   Find a Rule in the Data Base.
  15289.  
  15290.           Returns   None.  Sets RuleStructure->Fnd to True if Rule was
  15291.                     found.
  15292.  
  15293.           See Also  Rule:Add.
  15294.  
  15295.           Notes     Find a rule. In this function, parameters may be empty,
  15296.                     in which case the first matching index entry will be
  15297.                     returned.  Parameters must be empty from left to right,
  15298.                     that is, if Att has a value then Obj must also have a
  15299.                     value.  If a "hole" is left, then nothing will ever be
  15300.                     found.
  15301.  
  15302.                     When a rule is found, the structure will be filled with
  15303.                     the values of that rule and Fnd will be set to True. 
  15304.                     If Rule:Next is called with these values set, then the
  15305.                     next rule value is returned.  This process may be
  15306.                     continued until the value of the current rule does not
  15307.                     match the value of the original partial rule.  This
  15308.                     length is put in KLen after every successful search and
  15309.                     may be modified.
  15310.  
  15311.           Example   The HAIKU.J uses this function to save the word table
  15312.                     info.
  15313.  
  15314.  
  15315.  
  15316.  
  15317.  
  15318.  
  15319.  
  15320.  
  15321.  
  15322.  
  15323.  
  15324.  
  15325.  
  15326.  
  15327.  
  15328.  
  15329.  
  15330.  
  15331.  
  15332.  
  15333.  
  15334.  
  15335.           The JORF Manual (Shareware Disk Version)                      244
  15336.  
  15337.  
  15338.  
  15339.  
  15340.  
  15341.  
  15342.  
  15343.  
  15344.                                       Rule:Next
  15345.  
  15346.  
  15347.           Function  Rule:Next ( RuleStructure ) 
  15348.  
  15349.           Purpose   Find the next Rule in sequence.
  15350.  
  15351.           Returns   None.  Sets RuleStructure->Fnd to True if Rule was
  15352.                     found.
  15353.  
  15354.           See Also  Rule:Find.
  15355.  
  15356.           Notes     If RuleStructure->KLen is zero, this works just like
  15357.                     Rule:Find.  If not zero, this command finds the next
  15358.                     rule in a sequence.  This process may be continued
  15359.                     until the value of the current rule within the Klen
  15360.                     changes.  Values for Klen are: 
  15361.  
  15362.                     0    Rules with the same Type match
  15363.                     1    Rules with the same Type+Obj match
  15364.                     2    Rules with the same Type+Obj+Att match
  15365.                     3    Rules with the same Type+Obj+Att+Prob+Val match
  15366.  
  15367.  
  15368.           Example   See Rule:Add.
  15369.  
  15370.  
  15371.  
  15372.  
  15373.  
  15374.  
  15375.  
  15376.  
  15377.  
  15378.  
  15379.  
  15380.  
  15381.  
  15382.  
  15383.  
  15384.  
  15385.  
  15386.  
  15387.  
  15388.  
  15389.  
  15390.  
  15391.  
  15392.  
  15393.  
  15394.  
  15395.  
  15396.           Chapter Five - JORF Functions                                 245
  15397.  
  15398.  
  15399.  
  15400.  
  15401.  
  15402.  
  15403.  
  15404.  
  15405.                                       Rule:Prev
  15406.  
  15407.  
  15408.           Function  Rule:Prev ( RuleStructure ) 
  15409.  
  15410.           Purpose   Find previous Rule in sequence.
  15411.  
  15412.           Returns   None.  Sets RuleStructure->Fnd to True if Rule was
  15413.                     found.
  15414.  
  15415.           See Also  Rule:Next.
  15416.  
  15417.           Notes     This command is the opposite of Rule:Next.
  15418.  
  15419.  
  15420.  
  15421.  
  15422.  
  15423.  
  15424.  
  15425.  
  15426.  
  15427.  
  15428.  
  15429.  
  15430.  
  15431.  
  15432.  
  15433.  
  15434.  
  15435.  
  15436.  
  15437.  
  15438.  
  15439.  
  15440.  
  15441.  
  15442.  
  15443.  
  15444.  
  15445.  
  15446.  
  15447.  
  15448.  
  15449.  
  15450.  
  15451.  
  15452.  
  15453.  
  15454.  
  15455.  
  15456.  
  15457.           The JORF Manual (Shareware Disk Version)                      246
  15458.  
  15459.  
  15460.  
  15461.  
  15462.  
  15463.  
  15464.  
  15465.  
  15466.                                        Str:Aft
  15467.  
  15468.  
  15469.           Function  Str:Aft ( String, CharList ) 
  15470.  
  15471.           Purpose   Get substring starting with the first character not
  15472.                     specified in CharList.
  15473.  
  15474.           Returns   The substring.
  15475.  
  15476.           See Also  Str:AtChar.
  15477.  
  15478.           Notes     Skips over characters specified, and returns the string
  15479.                     after those characters.  The most common example is to
  15480.                     specify the string after any leading spaces. 
  15481.  
  15482.                     This command is the functional equivalent of the C
  15483.                     language strninset().
  15484.  
  15485.                     The return value is the substring, not the position.
  15486.  
  15487.           Example   See Jorf:Write.
  15488.  
  15489.  
  15490.  
  15491.  
  15492.  
  15493.  
  15494.  
  15495.  
  15496.  
  15497.  
  15498.  
  15499.  
  15500.  
  15501.  
  15502.  
  15503.  
  15504.  
  15505.  
  15506.  
  15507.  
  15508.  
  15509.  
  15510.  
  15511.  
  15512.  
  15513.  
  15514.  
  15515.  
  15516.  
  15517.  
  15518.           Chapter Five - JORF Functions                                 247
  15519.  
  15520.  
  15521.  
  15522.  
  15523.  
  15524.  
  15525.  
  15526.  
  15527.                                         Str:At
  15528.  
  15529.  
  15530.           Function  Str:At ( String, Position, Length ) 
  15531.  
  15532.           Purpose   Get a substring at specified position in String.
  15533.  
  15534.           Returns   The substring.
  15535.  
  15536.           See Also  Str:In.
  15537.  
  15538.           Notes     Returns the substring at the specified position and
  15539.                     length.  JORF does not think of single characters as
  15540.                     integers, as in BASIC, C and Pascal.  Instead, JORF
  15541.                     sees characters as one letter strings.  
  15542.  
  15543.                     The first character of the string is one (1) and the
  15544.                     last character is the return value of Str:Len.  
  15545.  
  15546.                     A negative Position indicates an offset from the right
  15547.                     (end) of the string.  A negative Length just counts
  15548.                     backward.  A Position or Length that are out of bounds
  15549.                     returns whatever part of the string is in bounds.
  15550.  
  15551.           Example   See Event:Add.
  15552.  
  15553.  
  15554.  
  15555.  
  15556.  
  15557.  
  15558.  
  15559.  
  15560.  
  15561.  
  15562.  
  15563.  
  15564.  
  15565.  
  15566.  
  15567.  
  15568.  
  15569.  
  15570.  
  15571.  
  15572.  
  15573.  
  15574.  
  15575.  
  15576.  
  15577.  
  15578.  
  15579.           The JORF Manual (Shareware Disk Version)                      248
  15580.  
  15581.  
  15582.  
  15583.  
  15584.  
  15585.  
  15586.  
  15587.  
  15588.                                       Str:AtChar
  15589.  
  15590.  
  15591.           Function  Str:AtChar ( String, CharList ) 
  15592.  
  15593.           Purpose   Get a substring starting with one of characters in
  15594.                     CharList. 
  15595.  
  15596.           Returns   The substring.
  15597.  
  15598.           See Also  Str:In.
  15599.  
  15600.           Notes     Get a substring starting with one of the specified
  15601.                     characters.  To look for a substring within a string,
  15602.                     use Str:In. 
  15603.  
  15604.                     Returns the substring, not the position. 
  15605.  
  15606.  
  15607.  
  15608.  
  15609.  
  15610.  
  15611.  
  15612.  
  15613.  
  15614.  
  15615.  
  15616.  
  15617.  
  15618.  
  15619.  
  15620.  
  15621.  
  15622.  
  15623.  
  15624.  
  15625.  
  15626.  
  15627.  
  15628.  
  15629.  
  15630.  
  15631.  
  15632.  
  15633.  
  15634.  
  15635.  
  15636.  
  15637.  
  15638.  
  15639.  
  15640.           Chapter Five - JORF Functions                                 249
  15641.  
  15642.  
  15643.  
  15644.  
  15645.  
  15646.  
  15647.  
  15648.  
  15649.                                       Str:AtCut
  15650.  
  15651.  
  15652.           Function  Str:AtCut ( String, Position ) 
  15653.  
  15654.           Purpose   Get a truncated version of string.
  15655.  
  15656.           Returns   The truncated string.
  15657.  
  15658.           See Also  Str:AtDel.
  15659.  
  15660.           Notes     Truncates String at Position.  This command is
  15661.                     functionally the same as:
  15662.  
  15663.                     Str:AtDel (String, Pos, Str:Len(String)-Pos)
  15664.  
  15665.                     If Position is less than one, or greater than the
  15666.                     length of String, then nothing will change.  
  15667.  
  15668.  
  15669.  
  15670.  
  15671.  
  15672.  
  15673.  
  15674.  
  15675.  
  15676.  
  15677.  
  15678.  
  15679.  
  15680.  
  15681.  
  15682.  
  15683.  
  15684.  
  15685.  
  15686.  
  15687.  
  15688.  
  15689.  
  15690.  
  15691.  
  15692.  
  15693.  
  15694.  
  15695.  
  15696.  
  15697.  
  15698.  
  15699.  
  15700.  
  15701.           The JORF Manual (Shareware Disk Version)                      250
  15702.  
  15703.  
  15704.  
  15705.  
  15706.  
  15707.  
  15708.  
  15709.  
  15710.                                       Str:AtDel
  15711.  
  15712.  
  15713.           Function  Str:AtDel ( String, Position, Count ) 
  15714.  
  15715.           Purpose   Returns a version of String with deleted characters.
  15716.  
  15717.           Returns   The modified string.
  15718.  
  15719.           See Also  Str:AtCut.
  15720.  
  15721.           Notes     Deletes Count characters from a string at Position.  If
  15722.                     Count is zero, or exceeds the length of the string,
  15723.                     then the string will be truncated at Position.  If
  15724.                     Position is less than one, or greater than the length
  15725.                     of String, then nothing will change.  
  15726.  
  15727.  
  15728.  
  15729.  
  15730.  
  15731.  
  15732.  
  15733.  
  15734.  
  15735.  
  15736.  
  15737.  
  15738.  
  15739.  
  15740.  
  15741.  
  15742.  
  15743.  
  15744.  
  15745.  
  15746.  
  15747.  
  15748.  
  15749.  
  15750.  
  15751.  
  15752.  
  15753.  
  15754.  
  15755.  
  15756.  
  15757.  
  15758.  
  15759.  
  15760.  
  15761.  
  15762.           Chapter Five - JORF Functions                                 251
  15763.  
  15764.  
  15765.  
  15766.  
  15767.  
  15768.  
  15769.  
  15770.  
  15771.                                       Str:AtPut
  15772.  
  15773.  
  15774.           Function  Str:AtPut ( String, Position, InsertString ) 
  15775.  
  15776.           Purpose   Insert a substring within string.
  15777.  
  15778.           Returns   The modified string.
  15779.  
  15780.           See Also  Str:AtSet.
  15781.  
  15782.           Notes     Inserts InsertString into String at Position.  If
  15783.                     Position is less than one, or greater than the length
  15784.                     of String, then nothing will change.  This command will
  15785.                     not overwrite existing characters.  Instead, it expands
  15786.                     the string to fit the new characters.  To replace
  15787.                     characters, first use Str:AtDel.
  15788.  
  15789.  
  15790.  
  15791.  
  15792.  
  15793.  
  15794.  
  15795.  
  15796.  
  15797.  
  15798.  
  15799.  
  15800.  
  15801.  
  15802.  
  15803.  
  15804.  
  15805.  
  15806.  
  15807.  
  15808.  
  15809.  
  15810.  
  15811.  
  15812.  
  15813.  
  15814.  
  15815.  
  15816.  
  15817.  
  15818.  
  15819.  
  15820.  
  15821.  
  15822.  
  15823.           The JORF Manual (Shareware Disk Version)                      252
  15824.  
  15825.  
  15826.  
  15827.  
  15828.  
  15829.  
  15830.  
  15831.  
  15832.                                       Str:AtSet
  15833.  
  15834.  
  15835.           Function  Str:AtSet ( String, Position, InsertString, Count ) 
  15836.  
  15837.           Purpose   Sets a repeated value into String.
  15838.  
  15839.           Returns   The modified string.
  15840.  
  15841.           See Also  Str:AtPut.
  15842.  
  15843.           Notes     Inserts InsertString, Count times, into String at
  15844.                     Position.  If Position is less than one, or greater
  15845.                     than the length of String, then nothing will change. 
  15846.                     This command will not overwrite existing characters. 
  15847.                     Instead, it expands the string to fit the new
  15848.                     characters.  To replace characters, first use
  15849.                     Str:AtDel.
  15850.  
  15851.                     This command is used to place a repeated pattern in a
  15852.                     string.  It also may  be used to create a buffer full
  15853.                     of a known value.  Use Str:AtSet(Null,1,"*", 15) to
  15854.                     create '***************'.  
  15855.  
  15856.                     To create a buffer full of spaces use Str:Pad, or nulls
  15857.                     with Str:NPad.
  15858.  
  15859.  
  15860.  
  15861.  
  15862.  
  15863.  
  15864.  
  15865.  
  15866.  
  15867.  
  15868.  
  15869.  
  15870.  
  15871.  
  15872.  
  15873.  
  15874.  
  15875.  
  15876.  
  15877.  
  15878.  
  15879.  
  15880.  
  15881.  
  15882.  
  15883.  
  15884.           Chapter Five - JORF Functions                                 253
  15885.  
  15886.  
  15887.  
  15888.  
  15889.  
  15890.  
  15891.  
  15892.  
  15893.                                         Str:In
  15894.  
  15895.  
  15896.           Function  Str:In ( String, Substring ) 
  15897.  
  15898.           Purpose   Returns the position of Substring in String.  
  15899.  
  15900.           Returns   A numeric position.  
  15901.  
  15902.           See Also  Other String functions.
  15903.  
  15904.           Notes     If Substring is not found then returns zero.  The
  15905.                     search is always insensitive to letter case.  The first
  15906.                     position is 1 and the last position is Str:Len(String)-
  15907.                     Str:Len(SubString).  A return value of zero or null
  15908.                     indicates the substring is not found in string.
  15909.  
  15910.                     Examples:
  15911.  
  15912.                     Str:In ("Josephine", "ph")    Result 5
  15913.                     Str:In ("Festus",    "f")     Result 1
  15914.                     Str:In ("Bear",      "EAR")   Result 2
  15915.                     Str:In ("Josephine", "Z")     Result 0
  15916.  
  15917.  
  15918.  
  15919.  
  15920.  
  15921.  
  15922.  
  15923.  
  15924.  
  15925.  
  15926.  
  15927.  
  15928.  
  15929.  
  15930.  
  15931.  
  15932.  
  15933.  
  15934.  
  15935.  
  15936.  
  15937.  
  15938.  
  15939.  
  15940.  
  15941.  
  15942.  
  15943.  
  15944.  
  15945.           The JORF Manual (Shareware Disk Version)                      254
  15946.  
  15947.  
  15948.  
  15949.  
  15950.  
  15951.  
  15952.  
  15953.  
  15954.                                        Str:Len
  15955.  
  15956.  
  15957.           Function  Str:Len ( String ) 
  15958.  
  15959.           Purpose   Get the number of characters in String.
  15960.  
  15961.           Returns   The number of characters in String.
  15962.  
  15963.           See Also  Text:Len.
  15964.  
  15965.           Notes     Returns the number of characters in a string.  Also
  15966.                     returns the string length of all JORF data types.  
  15967.  
  15968.                          String    String Length
  15969.                          Number    Length of number formatted as a string
  15970.                          Date      Length of date formatted as a string
  15971.                          Time      Length of time formatted as a string
  15972.                          Structure 0
  15973.                          Array     0
  15974.                          Text      Length of line pointed to by text
  15975.  
  15976.  
  15977.  
  15978.  
  15979.  
  15980.  
  15981.  
  15982.  
  15983.  
  15984.  
  15985.  
  15986.  
  15987.  
  15988.  
  15989.  
  15990.  
  15991.  
  15992.  
  15993.  
  15994.  
  15995.  
  15996.  
  15997.  
  15998.  
  15999.  
  16000.  
  16001.  
  16002.  
  16003.  
  16004.  
  16005.  
  16006.           Chapter Five - JORF Functions                                 255
  16007.  
  16008.  
  16009.  
  16010.  
  16011.  
  16012.  
  16013.  
  16014.  
  16015.                                        Str:NPad
  16016.  
  16017.  
  16018.           Function  Str:NPad ( String, Length ) 
  16019.  
  16020.           Purpose   Pad the end of String with nulls until it is the
  16021.                     specified Length.
  16022.  
  16023.           Returns   The modified String.
  16024.  
  16025.           See Also  Str:Pad.
  16026.  
  16027.           Notes     Not commonly used for anything but writing specialized
  16028.                     file formats.  Many file formats require fields that
  16029.                     are null padded, instead of space padded.  Use this
  16030.                     command to null pad your strings.
  16031.  
  16032.                     Once a string is null padded, most JORF functions will
  16033.                     reconvert the string back to it's smallest format.  You
  16034.                     should use this command just prior to writing a string
  16035.                     or buffer to file. 
  16036.  
  16037.  
  16038.  
  16039.  
  16040.  
  16041.  
  16042.  
  16043.  
  16044.  
  16045.  
  16046.  
  16047.  
  16048.  
  16049.  
  16050.  
  16051.  
  16052.  
  16053.  
  16054.  
  16055.  
  16056.  
  16057.  
  16058.  
  16059.  
  16060.  
  16061.  
  16062.  
  16063.  
  16064.  
  16065.  
  16066.  
  16067.           The JORF Manual (Shareware Disk Version)                      256
  16068.  
  16069.  
  16070.  
  16071.  
  16072.  
  16073.  
  16074.  
  16075.  
  16076.                                        Str:Pad
  16077.  
  16078.  
  16079.           Function  Str:Pad ( String, Length ) 
  16080.  
  16081.           Purpose   Pad the end of String with spaces, until it is the
  16082.                     specified Length.
  16083.  
  16084.           Returns   The modified String.
  16085.  
  16086.           See Also  Str:NPad.
  16087.  
  16088.           Notes     Commonly used to format consecutive strings for output
  16089.                     on the screen or printer.  By padding, you can column
  16090.                     align values.  If the string is too long, this command
  16091.                     will truncate it to the Pad length. 
  16092.  
  16093.  
  16094.  
  16095.  
  16096.  
  16097.  
  16098.  
  16099.  
  16100.  
  16101.  
  16102.  
  16103.  
  16104.  
  16105.  
  16106.  
  16107.  
  16108.  
  16109.  
  16110.  
  16111.  
  16112.  
  16113.  
  16114.  
  16115.  
  16116.  
  16117.  
  16118.  
  16119.  
  16120.  
  16121.  
  16122.  
  16123.  
  16124.  
  16125.  
  16126.  
  16127.  
  16128.           Chapter Five - JORF Functions                                 257
  16129.  
  16130.  
  16131.  
  16132.  
  16133.  
  16134.  
  16135.  
  16136.  
  16137.                                       Str:Print
  16138.  
  16139.  
  16140.           Function  Str:Print ( Printer, String ) 
  16141.  
  16142.           Purpose   Direct serial or parallel port output of a String.
  16143.  
  16144.           Returns   The modified String.
  16145.  
  16146.           See Also  Str:NPad.
  16147.  
  16148.           Notes     This command became obsolete for printing as of version
  16149.                     2.0 of the JORF Interpreter because MS-Windows does not
  16150.                     adequately support printing anything less than a data
  16151.                     file with a full page of output.
  16152.  
  16153.                     There are rare circumstances where programmers may
  16154.                     still require direct access to the output ports..  For
  16155.                     instance, to auto-dial a modem requires that you submit
  16156.                     the AT commands directly to the modems serial port. 
  16157.                     For this purpose, the Str:Print has been restored to
  16158.                     communicate directly with an output (serial or
  16159.                     parallel) prot.  
  16160.  
  16161.                     This command prints String to the designated port.  The
  16162.                     Port must be Prn, Aux, LPT1, LPT2, COM1, or COM2 to
  16163.                     indicate default printer, auxiliary port, line printer
  16164.                     one and two, and serial printer one and two. 
  16165.                     Internally, the interpreter uses both BIOS and DOS
  16166.                     calls to access the port.
  16167.  
  16168.                     You cannot set the speed of a serial port using the
  16169.                     JORF Interpreter.  Instead, use the DOS MODE command. 
  16170.                     To set up a Hayes compatible 2400 baud modem for
  16171.                     auto-dialing, you need to execute:
  16172.  
  16173.                          C>Mode Com1:2400,n,8,1,p
  16174.  
  16175.  
  16176.                     If this command works for you, you should put it in
  16177.                     your autoexec.bat file so it is executed when your
  16178.                     computer boots.
  16179.  
  16180.                     In theory, this function supports COM1 through COM9,
  16181.                     and LPT1 through LPT9.  In practice, the last port
  16182.                     accessed may be limited by your computer, Windows or
  16183.                     DOS.  
  16184.  
  16185.  
  16186.  
  16187.  
  16188.  
  16189.           The JORF Manual (Shareware Disk Version)                      258
  16190.  
  16191.  
  16192.  
  16193.  
  16194.  
  16195.  
  16196.  
  16197.  
  16198.                                        Str:Put
  16199.  
  16200.  
  16201.           Function  Str:Put ( String ) 
  16202.  
  16203.           Purpose   Put a string on the window.
  16204.  
  16205.           Returns   None.
  16206.  
  16207.           See Also  Str:PutLine.
  16208.  
  16209.           Notes     Outputs a JORF data pointer as a string to the current
  16210.                     window at the current cursor position.  You can use
  16211.                     this function to display the data from any JORF type
  16212.                     except structures.  To display a structure, you must
  16213.                     display the elements of that structure independently. 
  16214.  
  16215.                     You can mix text and variables two ways.  One is to
  16216.                     assemble them at print time by adding them together.
  16217.  
  16218.                          Jorf:MyPrint(Var1,Var2)
  16219.                            Str:Put("Var1 is "+Var1+" and var2 is "+Var2)
  16220.                            Return (Ok)
  16221.  
  16222.            
  16223.                     The other way is to surround variables in curly
  16224.                     brackets to indicate that they are magic spots.  This
  16225.                     method is faster, because magic spot processing is
  16226.                     faster than string concatenation.  This method will
  16227.                     does not work on windows where Win:Ptr->Magic is FALSE
  16228.                     because Win:Ptr->Magic controls whether magic spots are
  16229.                     interpreted.
  16230.  
  16231.  
  16232.                     Jorf:MyPrint(Var1,Var2)
  16233.                            Str:Put("Var1 is {Var1} and var2 is {Var2}")
  16234.                            Return (Ok)
  16235.  
  16236.            
  16237.                     This function is buffered for speed.  Calling this
  16238.                     function sets the internal buffer, but the buffer is
  16239.                     not shown on the screen until the line is finished. You
  16240.                     can force a display by changing to another line using
  16241.                     Move:To or by ending the line using Str:PutLine.
  16242.  
  16243.  
  16244.  
  16245.  
  16246.  
  16247.  
  16248.  
  16249.  
  16250.           Chapter Five - JORF Functions                                 259
  16251.  
  16252.  
  16253.  
  16254.  
  16255.  
  16256.  
  16257.  
  16258.  
  16259.                                      Str:PutLine
  16260.  
  16261.  
  16262.           Function  Str:PutLine ( Line ) 
  16263.  
  16264.           Purpose   Put string on window, then go to next line.
  16265.  
  16266.           Returns   None.
  16267.  
  16268.           See Also  Str:Put.
  16269.  
  16270.           Notes     Outputs a line to the current window, moves the cursor
  16271.                     to the next line.  This command differs from Str:Put
  16272.                     because it completes the line by moving the cursor. 
  16273.                     This function will re-display the entire text row in
  16274.                     the window.
  16275.  
  16276.  
  16277.  
  16278.  
  16279.  
  16280.  
  16281.  
  16282.  
  16283.  
  16284.  
  16285.  
  16286.  
  16287.  
  16288.  
  16289.  
  16290.  
  16291.  
  16292.  
  16293.  
  16294.  
  16295.  
  16296.  
  16297.  
  16298.  
  16299.  
  16300.  
  16301.  
  16302.  
  16303.  
  16304.  
  16305.  
  16306.  
  16307.  
  16308.  
  16309.  
  16310.  
  16311.           The JORF Manual (Shareware Disk Version)                      260
  16312.  
  16313.  
  16314.  
  16315.  
  16316.  
  16317.  
  16318.  
  16319.  
  16320.                                        Str:Rpad
  16321.  
  16322.  
  16323.           Function  Str:Rpad ( String, Length ) 
  16324.  
  16325.           Purpose   Pad the right side of String with spaces, until it is
  16326.                     the specified Length.
  16327.  
  16328.           Returns   The modified String.
  16329.  
  16330.           See Also  Str:Pad.
  16331.  
  16332.           Notes     Like Str:Pad this function is commonly used to format
  16333.                     stings, especially numbers where right justification is
  16334.                     desired.  By padding, you can column align values.  If
  16335.                     the string is too long, this command will truncate it
  16336.                     to the specified length. 
  16337.  
  16338.  
  16339.  
  16340.  
  16341.  
  16342.  
  16343.  
  16344.  
  16345.  
  16346.  
  16347.  
  16348.  
  16349.  
  16350.  
  16351.  
  16352.  
  16353.  
  16354.  
  16355.  
  16356.  
  16357.  
  16358.  
  16359.  
  16360.  
  16361.  
  16362.  
  16363.  
  16364.  
  16365.  
  16366.  
  16367.  
  16368.  
  16369.  
  16370.  
  16371.  
  16372.           Chapter Five - JORF Functions                                 261
  16373.  
  16374.  
  16375.  
  16376.  
  16377.  
  16378.  
  16379.  
  16380.  
  16381.                                      Struct:Find
  16382.  
  16383.  
  16384.           Function  Struct:Find ( Class, Index, Value ) 
  16385.  
  16386.           Purpose   Find a structure using an automatic index.
  16387.  
  16388.           Returns   Structure. 
  16389.  
  16390.           See Also  Struct:Next, Key:Find.
  16391.  
  16392.           Notes     When you define a structure with automatic indexes the
  16393.                     interpreter will automatically add, change and delete
  16394.                     that index.  This command allows you to find structures
  16395.                     that have previously been stored using this index.  
  16396.                     Set Class to the class name, the Index to the name of
  16397.                     the field that is indexed, and the Value to the value
  16398.                     you want to find.  If the search value is null, this
  16399.                     command returns the first item in the index.
  16400.  
  16401.           Example   The FILTER.J sample program is the simplest data base
  16402.                     of all.
  16403.  
  16404.  
  16405.  
  16406.  
  16407.  
  16408.  
  16409.  
  16410.  
  16411.  
  16412.  
  16413.  
  16414.  
  16415.  
  16416.  
  16417.  
  16418.  
  16419.  
  16420.  
  16421.  
  16422.  
  16423.  
  16424.  
  16425.  
  16426.  
  16427.  
  16428.  
  16429.  
  16430.  
  16431.  
  16432.  
  16433.           The JORF Manual (Shareware Disk Version)                      262
  16434.  
  16435.  
  16436.  
  16437.  
  16438.  
  16439.  
  16440.  
  16441.  
  16442.                                      Struct:Next
  16443.  
  16444.  
  16445.           Function  Struct:Next ( Class, Index, Value ) 
  16446.  
  16447.           Purpose   Find the next structure  in sequence.
  16448.  
  16449.           Returns   Structure.
  16450.  
  16451.           See Also  Struct:Find.
  16452.  
  16453.           Notes     If Value is null this command finds the first structure
  16454.                     in the file. Each subsequent call finds the next record
  16455.                     in sequence.  This function is widely used for Window
  16456.                     Lists where the Next command is used to find the next
  16457.                     record in the list.
  16458.  
  16459.                     If there are no more records in the index, this command
  16460.                     returns null.
  16461.  
  16462.  
  16463.  
  16464.  
  16465.  
  16466.  
  16467.  
  16468.  
  16469.  
  16470.  
  16471.  
  16472.  
  16473.  
  16474.  
  16475.  
  16476.  
  16477.  
  16478.  
  16479.  
  16480.  
  16481.  
  16482.  
  16483.  
  16484.  
  16485.  
  16486.  
  16487.  
  16488.  
  16489.  
  16490.  
  16491.  
  16492.  
  16493.  
  16494.           Chapter Five - JORF Functions                                 263
  16495.  
  16496.  
  16497.  
  16498.  
  16499.  
  16500.  
  16501.  
  16502.  
  16503.                                      Struct:Prev
  16504.  
  16505.  
  16506.           Function  Struct:Prev ( Class, Index, Value ) 
  16507.  
  16508.           Purpose   Find the previous structure  in sequence.
  16509.  
  16510.           Returns   Structure.
  16511.  
  16512.           See Also  Struct:Find.
  16513.  
  16514.           Notes     If Value is null this command finds nothing - not the
  16515.                     last structure in the index which is what you might
  16516.                     expect.  This function is widely used for Window Lists
  16517.                     when you use the up arrow to go up through a file.  
  16518.  
  16519.                     If the Value was already at the first record in the
  16520.                     index, this function returns null.
  16521.  
  16522.  
  16523.  
  16524.  
  16525.  
  16526.  
  16527.  
  16528.  
  16529.  
  16530.  
  16531.  
  16532.  
  16533.  
  16534.  
  16535.  
  16536.  
  16537.  
  16538.  
  16539.  
  16540.  
  16541.  
  16542.  
  16543.  
  16544.  
  16545.  
  16546.  
  16547.  
  16548.  
  16549.  
  16550.  
  16551.  
  16552.  
  16553.  
  16554.  
  16555.           The JORF Manual (Shareware Disk Version)                      264
  16556.  
  16557.  
  16558.  
  16559.  
  16560.  
  16561.  
  16562.  
  16563.  
  16564.                                    Switch/Case/Else
  16565.  
  16566.  
  16567.           Function  Switch/Case/Else
  16568.  
  16569.           Purpose   A conditional branch.
  16570.  
  16571.           Returns   None.
  16572.  
  16573.           See Also  If/Else.
  16574.  
  16575.           Notes     A conditional Branch.  Tests the value of a parameter
  16576.                     and executes indented code sections based on that
  16577.                     value. 
  16578.  
  16579.                          Switch ( TestValue ) 
  16580.                            Case Value1
  16581.                            Case Value2
  16582.                              Performs this section if TestValue is Value1
  16583.                              OR Value2
  16584.                            Else
  16585.                              If no Case was valid this section performed.
  16586.  
  16587.                     Tests a value and performs commands in indented
  16588.                     sections.  This command was introduced for the C
  16589.                     language, but was not robust.  I have strengthened the
  16590.                     command by eliminating the need for explicit Break
  16591.                     commands.  I have changed "Default" to Else.  And I
  16592.                     allow more complex processing on Case lines.
  16593.  
  16594.                     The Switch command does not need a parameter following. 
  16595.                     If the parameter is absent, the Case lines are expected
  16596.                     to be logical expressions that can be evaluated.  If
  16597.                     the parameter is present, the parameter is check
  16598.                     against the expression in the Case line.
  16599.  
  16600.                     Break may not be used, even by hopeless C programmers
  16601.                     like myself who put them in anyway.  It was never
  16602.                     robust to partially reuse code sections and K&R must
  16603.                     not have realized the ramifications when they created
  16604.                     the C language switch command.  They required an extra
  16605.                     key word for the common case and promoted the unwise
  16606.                     programming practice of allowing the program flow to
  16607.                     "fall" into another routine.
  16608.  
  16609.  
  16610.  
  16611.  
  16612.  
  16613.  
  16614.  
  16615.  
  16616.           Chapter Five - JORF Functions                                 265
  16617.  
  16618.  
  16619.  
  16620.  
  16621.  
  16622.  
  16623.  
  16624.  
  16625.           Examples  The Switch command is used to replace multiple If/Else
  16626.                     statements.  It checks a condition, and compares it to
  16627.                     various Case clauses.  It executes the indented section
  16628.                     under the appropriate Case.  It also has an Else
  16629.                     clause, which works just like the else in an If
  16630.                     statement.
  16631.  
  16632.                     For example:                       Is Replaced By
  16633.  
  16634.                     If (A=2)                           Switch (A)
  16635.                       B=A+C                              Case 2
  16636.                     Else                                   B=A+C
  16637.                       If (A=3)                           Case 3
  16638.                         B=A+D                              B=A+D
  16639.                       Else                               Case 4
  16640.                         If (A=4)                           B=A+E
  16641.                           B=A+E                          Else
  16642.                         Else                               B=A
  16643.                           B=A
  16644.  
  16645.  
  16646.                     Case functions may be stacked.
  16647.  
  16648.                         Switch (Key)                        
  16649.                           Case 'a'                          
  16650.                           Case 'A'                          
  16651.                             Say 'Key is A'                  
  16652.                           Case 'b'                          
  16653.                           Case 'B'                          
  16654.                             Say 'Key is B'                  
  16655.                           Else                              
  16656.                             Say 'Key is not A or B'  
  16657.  
  16658.  
  16659.                     The Switch function is neater and easier to use than
  16660.                     multiple If/Else functions.  The condition for the
  16661.                     switch command may be omitted, and the  Case commands
  16662.                     may be complex comparisons.
  16663.  
  16664.                             Switch
  16665.                              Case (Key>='a' && Key<='Z')
  16666.                              Case (Key>='A' && Key<='Z')
  16667.                                Say 'Key is a Letter'
  16668.                              Case (Key>='0' && Key<='9')
  16669.                                Say 'Key is a Number'
  16670.                              Else
  16671.                                Say 'Key is Something Else'
  16672.  
  16673.  
  16674.  
  16675.  
  16676.  
  16677.           The JORF Manual (Shareware Disk Version)                      266
  16678.  
  16679.  
  16680.  
  16681.  
  16682.  
  16683.  
  16684.  
  16685.  
  16686.                                        Text:Add
  16687.  
  16688.  
  16689.           Function  Text:Add ( Line, Text ) 
  16690.  
  16691.           Purpose   Append Line to the bottom of Text.
  16692.  
  16693.           Returns   Text.
  16694.  
  16695.           See Also  Line:Inp, Win:Add.
  16696.  
  16697.           Notes     Appends to existing text, or creates a new text.  This
  16698.                     command is commonly used to create paragraphs of text
  16699.                     for output to the screen or printer.
  16700.  
  16701.                     The return value is a JORF Pointer to text.  This is a
  16702.                     fascinating data type because it has two natures:  A
  16703.                     Pointer to text points to a string value for the
  16704.                     specific line of text, and a text value that is linked
  16705.                     to all the other lines of the text.  This is a little
  16706.                     confusing.  Basically String functions will bring out
  16707.                     the string nature of the current line, and Text
  16708.                     functions will allow you to work with the text nature
  16709.                     of a Text pointer.
  16710.  
  16711.                     Adding lines to text is done internally, and if you
  16712.                     want the new lines on a displayed text field to be
  16713.                     displayed you must use Win:Dsp after adding.  
  16714.  
  16715.                     Text is "sparse" in memory, meaning that if it is too
  16716.                     long, only portions are in RAM.  The remainder of the
  16717.                     text is stored on disk.  If you are creating a large
  16718.                     chunk of text, it will be swapped to the temporary
  16719.                     file.  If you later store the text in a data file,
  16720.                     there may be considerable delay as the text is copied
  16721.                     from the temporary swap file to your permanent file. 
  16722.                     For this reason, you may benefit from writing the first
  16723.                     line of text to your destination file as it is created. 
  16724.                     This insures that the entire text is written to the
  16725.                     final destination file, eliminating later delays.
  16726.  
  16727.                     Text is stored in 4K chunks.  When you reference a line
  16728.                     of text, the first 4K and the 4K chunk that contains
  16729.                     the line is loaded.  The chunks are indexed so that
  16730.                     obtaining the last line of text does not require
  16731.                     reading all chunks.  However, inserting a new line, or
  16732.                     deleting a line requires that all subsequent chunks be
  16733.                     rewritten.  That is why the system slows down for line
  16734.                     insert and line delete functions on text over 10K of
  16735.                     memory.  
  16736.  
  16737.  
  16738.           Chapter Five - JORF Functions                                 267
  16739.  
  16740.  
  16741.  
  16742.  
  16743.  
  16744.  
  16745.  
  16746.                     The maximum number of lines allows is 32K.  However,
  16747.                     speed and storage requirements will make any text with
  16748.                     more than 2000 lines pretty pokey and not advised. 
  16749.                     Each line of the text may be up to 10K bytes long.  The
  16750.                     10K limit is imposed by a bug in the Borland library in
  16751.                     failing to dependably allocate large blocks of memory. 
  16752.                     If this bug is fixed, the limit may go up to the JORF
  16753.                     language design goal of 32K bytes per line.
  16754.  
  16755.                     Warning:  If you are building a multi-line text, and
  16756.                     you get the parameters to Text:Add backward, your text
  16757.                     will not be created, and you will only see the last
  16758.                     line you added. 
  16759.  
  16760.           Example   See the HAIKU.J sample program. 
  16761.  
  16762.  
  16763.  
  16764.  
  16765.  
  16766.  
  16767.  
  16768.  
  16769.  
  16770.  
  16771.  
  16772.  
  16773.  
  16774.  
  16775.  
  16776.  
  16777.  
  16778.  
  16779.  
  16780.  
  16781.  
  16782.  
  16783.  
  16784.  
  16785.  
  16786.  
  16787.  
  16788.  
  16789.  
  16790.  
  16791.  
  16792.  
  16793.  
  16794.  
  16795.  
  16796.  
  16797.  
  16798.  
  16799.           The JORF Manual (Shareware Disk Version)                      268
  16800.  
  16801.  
  16802.  
  16803.  
  16804.  
  16805.  
  16806.  
  16807.  
  16808.                                        Text:At
  16809.  
  16810.  
  16811.           Function  Text:At ( Text, LineNumber )  
  16812.  
  16813.           Purpose   Get a specific line of Text.
  16814.  
  16815.           Returns   The line of Text.
  16816.  
  16817.           See Also  Text:Pos.
  16818.  
  16819.           Notes     Returns the line of Text at LineNumber.  If Text is not
  16820.                     a block of text, it is treated as a single line of
  16821.                     text.  If the LineNumber is greater than the length of
  16822.                     the text this function returns null.
  16823.  
  16824.                     The first line of text is at Text:At(Text,1).  The last
  16825.                     line of text is at Text:At(Text,Text:Len(Text)).
  16826.  
  16827.           Example   See Text:Bot
  16828.  
  16829.  
  16830.  
  16831.  
  16832.  
  16833.  
  16834.  
  16835.  
  16836.  
  16837.  
  16838.  
  16839.  
  16840.  
  16841.  
  16842.  
  16843.  
  16844.  
  16845.  
  16846.  
  16847.  
  16848.  
  16849.  
  16850.  
  16851.  
  16852.  
  16853.  
  16854.  
  16855.  
  16856.  
  16857.  
  16858.  
  16859.  
  16860.           Chapter Five - JORF Functions                                 269
  16861.  
  16862.  
  16863.  
  16864.  
  16865.  
  16866.  
  16867.  
  16868.  
  16869.                                        Text:Bot
  16870.  
  16871.  
  16872.           Function  Text:Bot ( Text ) 
  16873.  
  16874.           Purpose   Get the last line of a block of text.
  16875.  
  16876.           Returns   The last line of Text.
  16877.  
  16878.           See Also  Text:Top, Text:Next, Text:Len.
  16879.  
  16880.           Notes     Returns the last line of Text.  If Text is not a
  16881.                     multiple line text block, then returns Text as if it
  16882.                     were a one line text block.
  16883.  
  16884.           Example   The following program demonstrates the text commands. 
  16885.                     Note how Text:Top and Text:Bot return the top and
  16886.                     bottom of the whole method.  To find the top of the
  16887.                     block of text, check the number of leading spaces.
  16888.  
  16889.                     Text:Start 
  16890.                       | Sample for Text Functions 
  16891.                       Text:Sample 
  16892.                         This text was passed to 
  16893.                         to a method because: 
  16894.                         a) The method call 
  16895.                            needed a parameter 
  16896.                         b) The text was indented 
  16897.                       Return 
  16898.                      
  16899.                     Text:Sample Text 
  16900.                       New Win1, Win2 
  16901.                       Win1->Text = Text 
  16902.                       Win1->Row = 2 
  16903.                       Win1->Col = 2 
  16904.                       Win:Add (Win1) 
  16905.                      
  16906.                       Win2->Row=(-2) 
  16907.                       Win2->Col=(-2) 
  16908.                       Win2->Len=11 
  16909.                       Win2->Wid=40 
  16910.                       Win:Add (Win2) 
  16911.                      
  16912.                       Str:PutLine ("Text      = "+Text) 
  16913.                       Str:PutLine ("Text:Len  = "+Text:Len (Text))
  16914.                       Str:PutLine ("Text:Wid  = "+Text:Wid (Text)) 
  16915.                       Str:PutLine ("Text:Top  = "+Text:Top (Text)) 
  16916.                       Str:PutLine ("Text:Bot  = "+Text:Bot (Text)) 
  16917.                       Str:PutLine ("Text:At 2 = "+Text:At (Text, 2))
  16918.                       Text = Text:Next (Text) 
  16919.                       Str:PutLine ("Text:Next = "+Text)
  16920.  
  16921.           The JORF Manual (Shareware Disk Version)                      270
  16922.  
  16923.  
  16924.  
  16925.  
  16926.  
  16927.  
  16928.  
  16929.                       Text = Text:Next (Text) 
  16930.                       Str:PutLine ("Text:Next = "+Text)
  16931.                       Text = Text:Next (Text) 
  16932.                       Str:PutLine ("Text:Next = "+Text)
  16933.                       Text = Text:Next (Text) 
  16934.                       Str:PutLine ("Text:Next = "+Text) 
  16935.                       Str:PutLine ("Text:Pos  = "+Text:Pos (Text))
  16936.                       Text = Text:Prev (Text) 
  16937.                       Str:PutLine ("Text:Prev = "+Text) 
  16938.                       Win:Pause 
  16939.                       Return 
  16940.  
  16941.  
  16942.  
  16943.  
  16944.  
  16945.  
  16946.  
  16947.  
  16948.  
  16949.  
  16950.  
  16951.  
  16952.  
  16953.  
  16954.  
  16955.  
  16956.  
  16957.  
  16958.  
  16959.  
  16960.  
  16961.  
  16962.  
  16963.  
  16964.  
  16965.  
  16966.  
  16967.  
  16968.  
  16969.  
  16970.  
  16971.  
  16972.  
  16973.  
  16974.  
  16975.  
  16976.  
  16977.  
  16978.  
  16979.  
  16980.  
  16981.  
  16982.           Chapter Five - JORF Functions                                 271
  16983.  
  16984.  
  16985.  
  16986.  
  16987.  
  16988.  
  16989.  
  16990.  
  16991.                                        Text:Len
  16992.  
  16993.  
  16994.           Function  Text:Len ( Text ) 
  16995.  
  16996.           Purpose   Get number of lines in Text.
  16997.  
  16998.           Returns   Returns number of lines.
  16999.  
  17000.           See Also  Text:Len, Text:Wid.
  17001.  
  17002.           Notes     If Text is not a text block, it will be treated as a
  17003.                     single line.
  17004.  
  17005.           Example   See Text:Bot
  17006.  
  17007.  
  17008.  
  17009.  
  17010.  
  17011.  
  17012.  
  17013.  
  17014.  
  17015.  
  17016.  
  17017.  
  17018.  
  17019.  
  17020.  
  17021.  
  17022.  
  17023.  
  17024.  
  17025.  
  17026.  
  17027.  
  17028.  
  17029.  
  17030.  
  17031.  
  17032.  
  17033.  
  17034.  
  17035.  
  17036.  
  17037.  
  17038.  
  17039.  
  17040.  
  17041.  
  17042.  
  17043.           The JORF Manual (Shareware Disk Version)                      272
  17044.  
  17045.  
  17046.  
  17047.  
  17048.  
  17049.  
  17050.  
  17051.  
  17052.                                       Text:Next
  17053.  
  17054.  
  17055.           Function  Text:Next ( Text ) 
  17056.  
  17057.           Purpose   Gets the next line of Text.
  17058.  
  17059.           Returns   A Jorf Pointer to the next line of Text.
  17060.  
  17061.           See Also  Text:Prev, Text:Len.
  17062.  
  17063.           Notes     Returns the next line of Text.  If Text is on the last
  17064.                     line, or is not a block of text, this function returns
  17065.                     null.
  17066.  
  17067.           Example   See Text:Bot
  17068.  
  17069.  
  17070.  
  17071.  
  17072.  
  17073.  
  17074.  
  17075.  
  17076.  
  17077.  
  17078.  
  17079.  
  17080.  
  17081.  
  17082.  
  17083.  
  17084.  
  17085.  
  17086.  
  17087.  
  17088.  
  17089.  
  17090.  
  17091.  
  17092.  
  17093.  
  17094.  
  17095.  
  17096.  
  17097.  
  17098.  
  17099.  
  17100.  
  17101.  
  17102.  
  17103.  
  17104.           Chapter Five - JORF Functions                                 273
  17105.  
  17106.  
  17107.  
  17108.  
  17109.  
  17110.  
  17111.  
  17112.  
  17113.                                        Text:Pos
  17114.  
  17115.  
  17116.           Function  Text:Pos ( Text )  
  17117.  
  17118.           Purpose   Returns the line number of Text.
  17119.  
  17120.           Returns   The previous line of Text.
  17121.  
  17122.           See Also  Text:At.
  17123.  
  17124.           Notes     Returns the line number of Text.  If Text is on the
  17125.                     first line, or is not a block of text, this function
  17126.                     returns 1.
  17127.  
  17128.           Example   See Text:Bot
  17129.  
  17130.  
  17131.  
  17132.  
  17133.  
  17134.  
  17135.  
  17136.  
  17137.  
  17138.  
  17139.  
  17140.  
  17141.  
  17142.  
  17143.  
  17144.  
  17145.  
  17146.  
  17147.  
  17148.  
  17149.  
  17150.  
  17151.  
  17152.  
  17153.  
  17154.  
  17155.  
  17156.  
  17157.  
  17158.  
  17159.  
  17160.  
  17161.  
  17162.  
  17163.  
  17164.  
  17165.           The JORF Manual (Shareware Disk Version)                      274
  17166.  
  17167.  
  17168.  
  17169.  
  17170.  
  17171.  
  17172.  
  17173.  
  17174.                                       Text:Prev
  17175.  
  17176.  
  17177.           Function  Text:Prev ( Text ) 
  17178.  
  17179.           Purpose   Get previous line of Text.
  17180.  
  17181.           Returns   The previous line of Text.
  17182.  
  17183.           See Also  Text:Next.
  17184.  
  17185.           Notes     Returns the previous line of Text.  If Text is on the
  17186.                     first line, or is not a block of text, this function
  17187.                     returns null.
  17188.  
  17189.           Example   See Text:Bot
  17190.  
  17191.  
  17192.  
  17193.  
  17194.  
  17195.  
  17196.  
  17197.  
  17198.  
  17199.  
  17200.  
  17201.  
  17202.  
  17203.  
  17204.  
  17205.  
  17206.  
  17207.  
  17208.  
  17209.  
  17210.  
  17211.  
  17212.  
  17213.  
  17214.  
  17215.  
  17216.  
  17217.  
  17218.  
  17219.  
  17220.  
  17221.  
  17222.  
  17223.  
  17224.  
  17225.  
  17226.           Chapter Five - JORF Functions                                 275
  17227.  
  17228.  
  17229.  
  17230.  
  17231.  
  17232.  
  17233.  
  17234.  
  17235.                                        Text:Top
  17236.  
  17237.  
  17238.           Function  Text:Top ( Text ) 
  17239.  
  17240.           Purpose   Get a Jorf Pointer to the top of a block of text.
  17241.  
  17242.           Returns   A Jorf Pointer to the first line of a block of text.
  17243.  
  17244.           See Also  Text:Bot. Text:Next.
  17245.  
  17246.           Notes     Returns the first line of Text.  If Text is not a text
  17247.                     block, then Text is returned because it is treated as a
  17248.                     one line text block.
  17249.  
  17250.           Example   See Text:Bot
  17251.  
  17252.  
  17253.  
  17254.  
  17255.  
  17256.  
  17257.  
  17258.  
  17259.  
  17260.  
  17261.  
  17262.  
  17263.  
  17264.  
  17265.  
  17266.  
  17267.  
  17268.  
  17269.  
  17270.  
  17271.  
  17272.  
  17273.  
  17274.  
  17275.  
  17276.  
  17277.  
  17278.  
  17279.  
  17280.  
  17281.  
  17282.  
  17283.  
  17284.  
  17285.  
  17286.  
  17287.           The JORF Manual (Shareware Disk Version)                      276
  17288.  
  17289.  
  17290.  
  17291.  
  17292.  
  17293.  
  17294.  
  17295.  
  17296.                                        Text:Wid
  17297.  
  17298.  
  17299.           Function  Text:Wid ( Text ) 
  17300.  
  17301.           Purpose   Get the width necessary to display this block of text.
  17302.  
  17303.           Returns   The width of the widest line of Text.
  17304.  
  17305.           See Also  Str:Len.
  17306.  
  17307.           Notes     Returns the width of the widest line of Text.  The
  17308.                     common use of this function is to obtain the width of a
  17309.                     text box for display or printout purposes.  To insure
  17310.                     speed, only the first 60 lines are checked for width.
  17311.  
  17312.           Example   See Text:Bot
  17313.  
  17314.  
  17315.  
  17316.  
  17317.  
  17318.  
  17319.  
  17320.  
  17321.  
  17322.  
  17323.  
  17324.  
  17325.  
  17326.  
  17327.  
  17328.  
  17329.  
  17330.  
  17331.  
  17332.  
  17333.  
  17334.  
  17335.  
  17336.  
  17337.  
  17338.  
  17339.  
  17340.  
  17341.  
  17342.  
  17343.  
  17344.  
  17345.  
  17346.  
  17347.  
  17348.           Chapter Five - JORF Functions                                 277
  17349.  
  17350.  
  17351.  
  17352.  
  17353.  
  17354.  
  17355.  
  17356.  
  17357.                                        Time:Add
  17358.  
  17359.  
  17360.           Function  Time:Add ( Time, Minutes, Hours, Seconds )  
  17361.                     Time:Add ( Time, "HH:MM:SS" )  
  17362.  
  17363.           Purpose   Add the specified Minutes, Hours or Seconds from the
  17364.                     Time.
  17365.  
  17366.           Returns   A time.
  17367.  
  17368.           See Also  Time:Sub, Date:Add.
  17369.  
  17370.           Notes     This is a very specialized command that helps you
  17371.                     calculate one minute after or one hour after a time. 
  17372.                     Note the parameters are not in smallest-to-largest
  17373.                     order, but feature seconds last because that parameter
  17374.                     is not often set.
  17375.  
  17376.                     There is currently no logic overflow for when you set a
  17377.                     time past or before midnight. 
  17378.  
  17379.  
  17380.  
  17381.  
  17382.  
  17383.  
  17384.  
  17385.  
  17386.  
  17387.  
  17388.  
  17389.  
  17390.  
  17391.  
  17392.  
  17393.  
  17394.  
  17395.  
  17396.  
  17397.  
  17398.  
  17399.  
  17400.  
  17401.  
  17402.  
  17403.  
  17404.  
  17405.  
  17406.  
  17407.  
  17408.  
  17409.           The JORF Manual (Shareware Disk Version)                      278
  17410.  
  17411.  
  17412.  
  17413.  
  17414.  
  17415.  
  17416.  
  17417.  
  17418.                                        Time:Get
  17419.  
  17420.  
  17421.           Function  Time:Get 
  17422.  
  17423.           Purpose   Get system Time.
  17424.  
  17425.           Returns   A JORF pointer with the current system time.
  17426.  
  17427.           See Also  Time:Set.
  17428.  
  17429.           Notes     There is an internal data type for the time  Conversion
  17430.                     to this type is done using the To:Time function. 
  17431.                     Conversion from this types done using Time:Str.  These
  17432.                     functions are paralleled for date.
  17433.  
  17434.  
  17435.  
  17436.  
  17437.  
  17438.  
  17439.  
  17440.  
  17441.  
  17442.  
  17443.  
  17444.  
  17445.  
  17446.  
  17447.  
  17448.  
  17449.  
  17450.  
  17451.  
  17452.  
  17453.  
  17454.  
  17455.  
  17456.  
  17457.  
  17458.  
  17459.  
  17460.  
  17461.  
  17462.  
  17463.  
  17464.  
  17465.  
  17466.  
  17467.  
  17468.  
  17469.  
  17470.           Chapter Five - JORF Functions                                 279
  17471.  
  17472.  
  17473.  
  17474.  
  17475.  
  17476.  
  17477.  
  17478.  
  17479.                                        Time:Set
  17480.  
  17481.  
  17482.           Function  Time:Set ( Time ) 
  17483.  
  17484.           Purpose   Set DOS clock to the specified date.
  17485.  
  17486.           Returns   None.
  17487.  
  17488.           See Also  Date:Set, To:Time.
  17489.  
  17490.           Notes     Sets the DOS time.  Time should be the result of the
  17491.                     To:Time function.  You can also specify a string value
  17492.                     in the form of HH:MM.
  17493.  
  17494.                     Setting the DOS time and date does not always affect
  17495.                     the computer's system clock.  To permanently change the
  17496.                     time and date on your computer, you may have to use a
  17497.                     utility program.  Network computers often get their
  17498.                     date and time reset from the network file server. 
  17499.  
  17500.  
  17501.  
  17502.  
  17503.  
  17504.  
  17505.  
  17506.  
  17507.  
  17508.  
  17509.  
  17510.  
  17511.  
  17512.  
  17513.  
  17514.  
  17515.  
  17516.  
  17517.  
  17518.  
  17519.  
  17520.  
  17521.  
  17522.  
  17523.  
  17524.  
  17525.  
  17526.  
  17527.  
  17528.  
  17529.  
  17530.  
  17531.           The JORF Manual (Shareware Disk Version)                      280
  17532.  
  17533.  
  17534.  
  17535.  
  17536.  
  17537.  
  17538.  
  17539.  
  17540.                                      Time:SetFmt
  17541.  
  17542.  
  17543.           Function  Time:SetFmt ( FormatStructure )  
  17544.  
  17545.           Purpose   Changes the default time string, and AM/PM indicator
  17546.                     for Time:Str.
  17547.  
  17548.           Returns   None.
  17549.  
  17550.           See Also  Time:Str, Date:SetFmt.
  17551.  
  17552.           Notes     The structure may be any structure with the elements
  17553.                     specified below.  The Element values are parsed and
  17554.                     sorted in an internal static array.  Changing the
  17555.                     elements after setting them does not change the
  17556.                     internal array until you call Time:SetFmt again.  
  17557.  
  17558.                     This function does not return any values, but sets up
  17559.                     values for later use by Time:Str.
  17560.  
  17561.                     The structure values are as follows:
  17562.  
  17563.                     FormatStructure->Format       | Default MM/DD/YY format
  17564.  
  17565.                     FormatStructure->A1           | The name for AM
  17566.                     FormatStructure->A2           | The name for PM         
  17567.  
  17568.  
  17569.  
  17570.  
  17571.  
  17572.  
  17573.  
  17574.  
  17575.  
  17576.  
  17577.  
  17578.  
  17579.  
  17580.  
  17581.  
  17582.  
  17583.  
  17584.  
  17585.  
  17586.  
  17587.  
  17588.  
  17589.  
  17590.  
  17591.  
  17592.           Chapter Five - JORF Functions                                 281
  17593.  
  17594.  
  17595.  
  17596.  
  17597.  
  17598.  
  17599.  
  17600.  
  17601.                                        Time:Str
  17602.  
  17603.  
  17604.           Function  Time:Str ( Time, Format )  
  17605.  
  17606.           Purpose   Formats the time according to format.  
  17607.  
  17608.           Returns   A formatted string.
  17609.  
  17610.           See Also  Time:Get, Date:Str.
  17611.  
  17612.           Notes     The specified time should be the result of the To:Time
  17613.                     function that  returns JORF pointer with an internal
  17614.                     date value. (The internal value stores the time as a
  17615.                     long integer value of the number of hundredths of
  17616.                     seconds since midnight.  
  17617.  
  17618.                     The format is a string saying how to format the date. 
  17619.                     The following are special character within the format
  17620.                     string:
  17621.  
  17622.                                    Time Formatters
  17623.  
  17624.                     h  = Hours                    Caps is military time
  17625.                     _h = Hours, space in front    Caps is military time
  17626.                     hh = Hours, zero in front     Caps is military time
  17627.                     m  = Minutes                  Caps is ignored
  17628.                     _m = Minutes, space in front  Caps is ignored
  17629.                     mm = Minutes, zero in front   Caps is ignored
  17630.                     s  = Seconds                  Caps is ignored
  17631.                     _s = Seconds, space in front  Caps is ignored
  17632.                     ss = seconds, zero in front   Caps is ignored
  17633.                     a  = am or pm                 Caps means AM or PM
  17634.  
  17635.                     Time in "Military Time" is based on a 24 hour clock
  17636.                     from 00:00 to 23:59.  When not in military time, the
  17637.                     hour after midnight is 12:00 AM to 12:50 AM, and noon
  17638.                     is 12:00 PM.
  17639.  
  17640.                     Any other characters are retained as-is, including
  17641.                     other letters.
  17642.  
  17643.                     The following examples show how the time 14:10 would be
  17644.                     formatted:
  17645.  
  17646.  
  17647.                     Time:Str(Time,"h:mm a")            result "2:10 pm"
  17648.                          Time:Str(Time,"hh:mm A")      result "02:10 PM"
  17649.                          Time:Str(Time,"HH:MM")        result "14:10"
  17650.                          Time:Str(Time,"H")            result "14"
  17651.                          Time:Str(Time,"h")            result "2"
  17652.  
  17653.           The JORF Manual (Shareware Disk Version)                      282
  17654.  
  17655.  
  17656.  
  17657.  
  17658.  
  17659.  
  17660.  
  17661.                     You can easily change the AM/PM indicator using  the
  17662.                     Time:SetFmt function.  If the format is omitted, the
  17663.                     default format of "HH:MM" is used.  This default can be
  17664.                     changed using Time:SetFmt.
  17665.  
  17666.  
  17667.  
  17668.  
  17669.  
  17670.  
  17671.  
  17672.  
  17673.  
  17674.  
  17675.  
  17676.  
  17677.  
  17678.  
  17679.  
  17680.  
  17681.  
  17682.  
  17683.  
  17684.  
  17685.  
  17686.  
  17687.  
  17688.  
  17689.  
  17690.  
  17691.  
  17692.  
  17693.  
  17694.  
  17695.  
  17696.  
  17697.  
  17698.  
  17699.  
  17700.  
  17701.  
  17702.  
  17703.  
  17704.  
  17705.  
  17706.  
  17707.  
  17708.  
  17709.  
  17710.  
  17711.  
  17712.  
  17713.  
  17714.           Chapter Five - JORF Functions                                 283
  17715.  
  17716.  
  17717.  
  17718.  
  17719.  
  17720.  
  17721.  
  17722.  
  17723.                                        Time:Sub
  17724.  
  17725.  
  17726.           Function  Time:Sub ( Time, Minutes, Hours, Seconds )  
  17727.                     Time:Sub ( Time, "HH:MM:SS" )  
  17728.  
  17729.           Purpose   Subtract the specified Minutes, Hours or Seconds from
  17730.                     the Time.
  17731.  
  17732.           Returns   A time.
  17733.  
  17734.           See Also  Time:Add, Date:Sub.
  17735.  
  17736.           Notes     This is a very specialized command that helps you
  17737.                     calculate one minute before or one hour before a time. 
  17738.                     Note the parameters are not in smallest-to-largest
  17739.                     order, but feature seconds last because that parameter
  17740.                     is not often set.
  17741.  
  17742.                     There is currently no logic overflow for when you set a
  17743.                     time past or before midnight. 
  17744.  
  17745.  
  17746.  
  17747.  
  17748.  
  17749.  
  17750.  
  17751.  
  17752.  
  17753.  
  17754.  
  17755.  
  17756.  
  17757.  
  17758.  
  17759.  
  17760.  
  17761.  
  17762.  
  17763.  
  17764.  
  17765.  
  17766.  
  17767.  
  17768.  
  17769.  
  17770.  
  17771.  
  17772.  
  17773.  
  17774.  
  17775.           The JORF Manual (Shareware Disk Version)                      284
  17776.  
  17777.  
  17778.  
  17779.  
  17780.  
  17781.  
  17782.  
  17783.  
  17784.                                       Time:Ticks
  17785.  
  17786.  
  17787.           Function  Time:Ticks
  17788.  
  17789.           Purpose   Gives an accurate timing mechanism.
  17790.  
  17791.           Returns   The number of ticks since midnight.
  17792.  
  17793.           See Also  Time:Get.
  17794.  
  17795.           Notes     Returns the number clock ticks since midnight.  This
  17796.                     may be used to time methods and program processes. 
  17797.                     This allows you to time operations with greater
  17798.                     precision than the seconds in the Time:Get command
  17799.                     allows.  
  17800.  
  17801.                     Currently there are 18 ticks per second on all DOS and
  17802.                     Windows based systems. 
  17803.  
  17804.  
  17805.  
  17806.  
  17807.  
  17808.  
  17809.  
  17810.  
  17811.  
  17812.  
  17813.  
  17814.  
  17815.  
  17816.  
  17817.  
  17818.  
  17819.  
  17820.  
  17821.  
  17822.  
  17823.  
  17824.  
  17825.  
  17826.  
  17827.  
  17828.  
  17829.  
  17830.  
  17831.  
  17832.  
  17833.  
  17834.  
  17835.  
  17836.           Chapter Five - JORF Functions                                 285
  17837.  
  17838.  
  17839.  
  17840.  
  17841.  
  17842.  
  17843.  
  17844.  
  17845.                                        To:ASCII
  17846.  
  17847.  
  17848.           Function  To:ASCII ( String ) 
  17849.  
  17850.           Purpose   Get ASCII value of first character of String.
  17851.  
  17852.           Returns   Returns the ASCII decimal value.
  17853.  
  17854.           See Also  To:Char.
  17855.  
  17856.           Notes     Converts a letter to its ASCII decimal value.  For
  17857.                     instance To:ASCII "A" returns 41.  Generally String
  17858.                     contains only one character, but can be a word or line
  17859.                     of text.
  17860.  
  17861.  
  17862.  
  17863.  
  17864.  
  17865.  
  17866.  
  17867.  
  17868.  
  17869.  
  17870.  
  17871.  
  17872.  
  17873.  
  17874.  
  17875.  
  17876.  
  17877.  
  17878.  
  17879.  
  17880.  
  17881.  
  17882.  
  17883.  
  17884.  
  17885.  
  17886.  
  17887.  
  17888.  
  17889.  
  17890.  
  17891.  
  17892.  
  17893.  
  17894.  
  17895.  
  17896.  
  17897.           The JORF Manual (Shareware Disk Version)                      286
  17898.  
  17899.  
  17900.  
  17901.  
  17902.  
  17903.  
  17904.  
  17905.  
  17906.                                        To:Caps
  17907.  
  17908.  
  17909.           Function  To:Caps ( String ) 
  17910.  
  17911.           Purpose   Capitalize a string.
  17912.  
  17913.           Returns   Returns the capitalized string.
  17914.  
  17915.           See Also  To:Ucs.
  17916.  
  17917.           Notes     Insures that any character following a space in String
  17918.                     is an upper case letter.  Does not affect words or
  17919.                     acronyms that are already in capital letters.  This is
  17920.                     used to change the appearance of strings for screen
  17921.                     display. 
  17922.  
  17923.  
  17924.  
  17925.  
  17926.  
  17927.  
  17928.  
  17929.  
  17930.  
  17931.  
  17932.  
  17933.  
  17934.  
  17935.  
  17936.  
  17937.  
  17938.  
  17939.  
  17940.  
  17941.  
  17942.  
  17943.  
  17944.  
  17945.  
  17946.  
  17947.  
  17948.  
  17949.  
  17950.  
  17951.  
  17952.  
  17953.  
  17954.  
  17955.  
  17956.  
  17957.  
  17958.           Chapter Five - JORF Functions                                 287
  17959.  
  17960.  
  17961.  
  17962.  
  17963.  
  17964.  
  17965.  
  17966.  
  17967.                                        To:Char
  17968.  
  17969.  
  17970.           Function  To:Char ( Value ) 
  17971.  
  17972.           Purpose   Returns a one character string with the letter
  17973.                     designated by the ASCII Value.
  17974.  
  17975.           Returns   Returns the one letter string.
  17976.  
  17977.           See Also  To:ASCII.
  17978.  
  17979.           Notes     For example, To:Char (41) returns "A".
  17980.  
  17981.  
  17982.  
  17983.  
  17984.  
  17985.  
  17986.  
  17987.  
  17988.  
  17989.  
  17990.  
  17991.  
  17992.  
  17993.  
  17994.  
  17995.  
  17996.  
  17997.  
  17998.  
  17999.  
  18000.  
  18001.  
  18002.  
  18003.  
  18004.  
  18005.  
  18006.  
  18007.  
  18008.  
  18009.  
  18010.  
  18011.  
  18012.  
  18013.  
  18014.  
  18015.  
  18016.  
  18017.  
  18018.  
  18019.           The JORF Manual (Shareware Disk Version)                      288
  18020.  
  18021.  
  18022.  
  18023.  
  18024.  
  18025.  
  18026.  
  18027.  
  18028.                                        To:Date
  18029.  
  18030.  
  18031.           Function  To:Date ( Date, Format )  
  18032.  
  18033.           Purpose   Converts a string to a date according to format.  
  18034.  
  18035.           Returns   A JORF pointer holding a date value.
  18036.  
  18037.           See Also  To:Time, Date:Str.
  18038.  
  18039.           Notes     Starting with version 2.1 of the JORF language, time
  18040.                     and date are atomic JORF data types.  This command
  18041.                     converts a string into the more compact internal date
  18042.                     format.  (The date is stored as the number of days
  18043.                     since the hypothetical 01/01/00).
  18044.  
  18045.                     The format is a string saying how to format the date. 
  18046.                     The following are special character within the format
  18047.                     string:
  18048.  
  18049.                                    Date Formatters
  18050.  
  18051.                     s    = String month Caps makes string upper case
  18052.                     w    = String weekday    Caps makes string upper case
  18053.                     n    = Numeric weekday   Caps is ignored
  18054.                     m    = Month             Caps is ignored
  18055.                     mm   = Month, zero in front   Caps is ignored
  18056.                     d    = Day                    Caps is ignored
  18057.                     dd   = Day, zero in front     Caps is ignored
  18058.                     y    = Year                   Caps is ignored
  18059.                     yy   = Two digit year         Caps is ignored
  18060.                     yyyy = Four digit year        Caps is ignored
  18061.  
  18062.                     If the format is omitted, the default format is used. 
  18063.                     The default format is "MM/DD/YY".  This format can be
  18064.                     changed using Date:SetFmt. 
  18065.  
  18066.  
  18067.  
  18068.  
  18069.  
  18070.  
  18071.  
  18072.  
  18073.  
  18074.  
  18075.  
  18076.  
  18077.  
  18078.  
  18079.  
  18080.           Chapter Five - JORF Functions                                 289
  18081.  
  18082.  
  18083.  
  18084.  
  18085.  
  18086.  
  18087.  
  18088.  
  18089.                                         To:Int
  18090.  
  18091.  
  18092.           Function  To:Int ( Num ) 
  18093.  
  18094.           Purpose   Returns the integer value of Num
  18095.  
  18096.           Returns   Integer.
  18097.  
  18098.           See Also  Num:Str.
  18099.  
  18100.           Notes     This function truncates decimals, returning the next
  18101.                     lower integer value for positive numbers, and the next
  18102.                     higher integer for negative numbers.  You can also
  18103.                     create integer strings (which are often automatically
  18104.                     converted to numbers) using the Num:Str function.   
  18105.  
  18106.  
  18107.  
  18108.  
  18109.  
  18110.  
  18111.  
  18112.  
  18113.  
  18114.  
  18115.  
  18116.  
  18117.  
  18118.  
  18119.  
  18120.  
  18121.  
  18122.  
  18123.  
  18124.  
  18125.  
  18126.  
  18127.  
  18128.  
  18129.  
  18130.  
  18131.  
  18132.  
  18133.  
  18134.  
  18135.  
  18136.  
  18137.  
  18138.  
  18139.  
  18140.  
  18141.           The JORF Manual (Shareware Disk Version)                      290
  18142.  
  18143.  
  18144.  
  18145.  
  18146.  
  18147.  
  18148.  
  18149.  
  18150.                                         To:Lcs
  18151.  
  18152.  
  18153.           Function  To:Lcs ( String ) 
  18154.  
  18155.           Purpose   Convert a string to lower case.
  18156.  
  18157.           Returns   The lower case string.
  18158.  
  18159.           See Also  To:Ucs.
  18160.  
  18161.           Notes     Converts all characters, including initials and
  18162.                     acronyms, to lower case.  
  18163.  
  18164.  
  18165.  
  18166.  
  18167.  
  18168.  
  18169.  
  18170.  
  18171.  
  18172.  
  18173.  
  18174.  
  18175.  
  18176.  
  18177.  
  18178.  
  18179.  
  18180.  
  18181.  
  18182.  
  18183.  
  18184.  
  18185.  
  18186.  
  18187.  
  18188.  
  18189.  
  18190.  
  18191.  
  18192.  
  18193.  
  18194.  
  18195.  
  18196.  
  18197.  
  18198.  
  18199.  
  18200.  
  18201.  
  18202.           Chapter Five - JORF Functions                                 291
  18203.  
  18204.  
  18205.  
  18206.  
  18207.  
  18208.  
  18209.  
  18210.  
  18211.                                         To:Num
  18212.  
  18213.  
  18214.           Function  To:Num ( String, Base ) 
  18215.  
  18216.           Purpose   Convert String to its numeric value.  Does not change
  18217.                     items that are already numbers.
  18218.  
  18219.           Returns   Returns the numeric value.
  18220.  
  18221.           See Also  Num:Str.
  18222.  
  18223.           Notes     This function is used to convert to strings and to
  18224.                     format them.
  18225.            
  18226.                     You can use another numbering Base for the conversion. 
  18227.                     If Base is omitted or does not have a numeric value,
  18228.                     then BASE 10 is used.   Use a Base of 16 for
  18229.                     Hexadecimal, 8 for Octal, or any number from 2 through
  18230.                     36 for other bases. 
  18231.  
  18232.                     Strings may be integers, decimals and floating point
  18233.                     numbers with "E" notation (ex. "3.24E-4").  This
  18234.                     command does not change values  that are already
  18235.                     numbers, and may be used as a precautionary measure
  18236.                     when the value might or might not have already been
  18237.                     converted.
  18238.  
  18239.           Example   The CALC.J program assembles numbers
  18240.                     as character strings so that when you
  18241.                     hit a new digit, that digit is
  18242.                     appended to the number.  When you hit
  18243.                     a calculation key, like the plus sign
  18244.                     (+) the string numbers must be
  18245.                     converted to numeric numbers before
  18246.                     adding.  
  18247.  
  18248.           Class:Calc      | Declare class Calc
  18249.             Entry         | Current entry value
  18250.             Op            | Last operation key
  18251.             Result        | Result of last calc
  18252.  
  18253.           Calc:start
  18254.             New(Calc:Calc)
  18255.             Calc->Entry  = "0"
  18256.             Calc->Result = "0"
  18257.             Mem:Ptr->Calc=Calc
  18258.             Event:Add(Null)
  18259.  
  18260.             Win:Add ("Calculator",0,0,8,17)
  18261.               Button:"&=",    Row:8, Col:14, Wid:3, Len:1 Action:"Calc:Do('=')"
  18262.  
  18263.           The JORF Manual (Shareware Disk Version)                      292
  18264.  
  18265.  
  18266.  
  18267.  
  18268.  
  18269.  
  18270.  
  18271.               Input:"Res"  Row:1, Col:2, Wid:11, Len:1
  18272.                 Field:"Mem:Ptr->Calc->Result" Before:"Null"
  18273.               Input:"Ent"  Row:2, Col:2, Wid:9, Len:1
  18274.                 Field:"Mem:Ptr->Calc->Entry" Before:"Null"
  18275.               Input:""        Row:2, Col:15, Wid:1, Len:1
  18276.                 Field:"Mem:Ptr->Calc->Op"    Before:"Null"
  18277.               HLine:"" Row:3
  18278.               Button:"&C",    Row:4, Col:2,  Wid:3, Len:1 Action:"Calc:Do('C')"
  18279.               Button:"c&E",   Row:4, Col:6,  Wid:3, Len:1 Action:"Calc:Do('E')"
  18280.               Button:"e&Xit", Row:4, Col:10, Wid:3, Len:1 Action:"Calc:Do('X')"
  18281.               Button:"&/",    Row:4, Col:14, Wid:3, Len:1 Action:"Calc:Do('/')"
  18282.  
  18283.               Button:"&7",    Row:5, Col:2,  Wid:3, Len:1 Action:"Calc:Do('7')"
  18284.               Button:"&8",    Row:5, Col:6,  Wid:3, Len:1 Action:"Calc:Do('8')"
  18285.               Button:"&9",    Row:5, Col:10, Wid:3, Len:1 Action:"Calc:Do('9')"
  18286.               Button:"&*",    Row:5, Col:14, Wid:3, Len:1 Action:"Calc:Do('*')"
  18287.  
  18288.               Button:"&4",    Row:6, Col:2,  Wid:3, Len:1 Action:"Calc:Do('4')"
  18289.               Button:"&5",    Row:6, Col:6 , Wid:3, Len:1 Action:"Calc:Do('5')"
  18290.               Button:"&6",    Row:6, Col:10, Wid:3, Len:1 Action:"Calc:Do('6')"
  18291.               Button:"&-",    Row:6, Col:14, Wid:3, Len:1 Action:"Calc:Do('-')"
  18292.  
  18293.               Button:"&1",    Row:7, Col:2,  Wid:3, Len:1 Action:"Calc:Do('1')"
  18294.               Button:"&2",    Row:7, Col:6 , Wid:3, Len:1 Action:"Calc:Do('2')"
  18295.               Button:"&3",    Row:7, Col:10, Wid:3, Len:1 Action:"Calc:Do('3')"
  18296.               Button:"&+",    Row:7, Col:14, Wid:3, Len:1 Action:"Calc:Do('+')"
  18297.  
  18298.               Button:"&0",    Row:8, Col:2,  Wid:3, Len:1 Action:"Calc:Do('0')"
  18299.               Button:"&.",    Row:8, Col:6,  Wid:3, Len:1 Action:"Calc:Do('.')"
  18300.               Button:"C&S",   Row:8, Col:10, Wid:3, Len:1 Action:"Calc:Do('S')"
  18301.             Return (Mem:Ptr->Calc->Result)
  18302.  
  18303.           Calc:Do(KeyLetter)
  18304.             New (Calc)
  18305.             Calc=Mem:Ptr->Calc
  18306.  
  18307.             Switch KeyLetter
  18308.               Case "X"
  18309.                 Jorf:Exit()
  18310.               Case "C"
  18311.                 Calc->Result="0"
  18312.                 Calc->Entry ="0"
  18313.                 Calc->Op    =Null
  18314.               Case "E"
  18315.                 Calc->Entry ="0"
  18316.               Case "S"
  18317.                 If (Calc->Entry!="0")
  18318.                   Calc->Entry = 0-Calc->Entry
  18319.                 Else
  18320.                   If (Calc->Result!="0")
  18321.                     Calc->Result = 0-Calc->Result
  18322.               Case "-"
  18323.  
  18324.           Chapter Five - JORF Functions                                 293
  18325.  
  18326.  
  18327.  
  18328.  
  18329.  
  18330.  
  18331.  
  18332.               Case "+"
  18333.               Case "/"
  18334.               Case "*"
  18335.               Case "="
  18336.                 If (Calc->Entry!="0")
  18337.                   Switch (Calc->Op)
  18338.                     Case "-"
  18339.                       Calc->Result = To:Num(Calc->Result) - To:Num(Calc->Entry)
  18340.                     Case "+"
  18341.                       Calc->Result = To:Num(Calc->Result) + To:Num(Calc->Entry)
  18342.                     Case "*"
  18343.                       Calc->Result = To:Num(Calc->Result) * To:Num(Calc->Entry)
  18344.                     Case "/"
  18345.                       Calc->Result = To:Num(Calc->Result) / To:Num(Calc->Entry)
  18346.                     Else
  18347.                       Calc->Result = Calc->Entry
  18348.                 Calc->Entry  = "0"
  18349.                 Calc->Op     = KeyLetter
  18350.               Else
  18351.                 If Str:In("1234567890.",KeyLetter)
  18352.                   If (Calc->Op == "=" Or Calc->Entry=="0")
  18353.                     Calc->Entry = KeyLetter
  18354.                     If (Calc->Op=="=")
  18355.                       Calc->Op    = Null
  18356.                   Else
  18357.                     Calc->Entry = Calc->Entry + KeyLetter
  18358.             Kbd:Put("Home_Key")
  18359.             Win:Dsp
  18360.             Return Ok
  18361.  
  18362.  
  18363.  
  18364.  
  18365.  
  18366.  
  18367.  
  18368.  
  18369.  
  18370.  
  18371.  
  18372.  
  18373.  
  18374.  
  18375.  
  18376.  
  18377.  
  18378.  
  18379.  
  18380.  
  18381.  
  18382.  
  18383.  
  18384.  
  18385.           The JORF Manual (Shareware Disk Version)                      294
  18386.  
  18387.  
  18388.  
  18389.  
  18390.  
  18391.  
  18392.  
  18393.  
  18394.           Special
  18395.           Note      Some countries use the comma for a decimal point, and
  18396.                     the period for the thousands indicator.  You can make
  18397.                     this the default by setting Decimal=, in the JORF.INI
  18398.                     file (See appendix D).  After setting this value,
  18399.                     numbers stored as strings will be converted according
  18400.                     to comma-decimal format.   Sometimes, numbers stored as
  18401.                     strings are in period-decimal format and need a special
  18402.                     conversion.  
  18403.  
  18404.                     Number              As Period decimal        As Comma decimal
  18405.                     "1,233.2"      1233.2              1.233
  18406.                     "1.233,2"      1.233               1233.2
  18407.  
  18408.  
  18409.                     To handle a value that was stored as a string in period
  18410.                     decimal format, use To:Num(Value,".").  Using a period
  18411.                     or comma as the Base causes a base 10 conversion with
  18412.                     an override on the user's setting for the decimal
  18413.                     format.  This feature can also be used when reading
  18414.                     decimal values from an ascii file that must be
  18415.                     converted to numbers without regard to the user's
  18416.                     Decimal= setting.
  18417.  
  18418.                     When a user runs a program with "Decimal=,", only the
  18419.                     user's input and output takes on the new format.  All
  18420.                     calculations and number formats in the JORF program
  18421.                     code must be in period-decimal format.  That way, the
  18422.                     code is international, only what the user see's changes
  18423.                     according to the INI file setting.
  18424.  
  18425.  
  18426.  
  18427.  
  18428.  
  18429.  
  18430.  
  18431.  
  18432.  
  18433.  
  18434.  
  18435.  
  18436.  
  18437.  
  18438.  
  18439.  
  18440.  
  18441.  
  18442.  
  18443.  
  18444.  
  18445.  
  18446.           Chapter Five - JORF Functions                                 295
  18447.  
  18448.  
  18449.  
  18450.  
  18451.  
  18452.  
  18453.  
  18454.  
  18455.                                        To:Time
  18456.  
  18457.  
  18458.           Function  To:Time ( Time, Format )  
  18459.  
  18460.           Purpose   Converts a string to a time according to format.  
  18461.  
  18462.           Returns   A JORF pointer holding a time value.
  18463.  
  18464.           See Also  To:Date, Time:Str.
  18465.  
  18466.           Notes     Starting with version 2.1 of the JORF language, time
  18467.                     and date are atomic JORF data types.  This command
  18468.                     converts a string into the more compact internal time
  18469.                     format.  (The time is stored as the number of seconds
  18470.                     since midnight).
  18471.  
  18472.                     The format is a string saying how to format the date. 
  18473.                     The following are special character within the format
  18474.                     string:
  18475.  
  18476.                                    Time Formatters
  18477.  
  18478.                     h  = Hours                    Caps is military time
  18479.                     _h = Hours, space in front    Caps is military time
  18480.                     hh = Hours, zero in front     Caps is military time
  18481.                     m  = Minutes                  Caps is ignored
  18482.                     _m = Minutes, space in front  Caps is ignored
  18483.                     mm = Minutes, zero in front   Caps is ignored
  18484.                     s  = Seconds                  Caps is ignored
  18485.                     _s = Seconds, space in front  Caps is ignored
  18486.                     ss = seconds, zero in front   Caps is ignored
  18487.                     a  = am or pm                 Caps means AM or PM
  18488.  
  18489.                     Time in "Military Time" is based on a 24 hour clock
  18490.                     from 00:00 to 23:59.  When not in military time, the
  18491.                     hour after midnight is 12:00 AM to 12:50 AM, and noon
  18492.                     is 12:00 PM.
  18493.  
  18494.                     If the format is omitted, the default format is used. 
  18495.                     The default format is "HH:MM".  This format can be
  18496.                     changed using Time:SetFmt. 
  18497.  
  18498.  
  18499.  
  18500.  
  18501.  
  18502.  
  18503.  
  18504.  
  18505.  
  18506.  
  18507.           The JORF Manual (Shareware Disk Version)                      296
  18508.  
  18509.  
  18510.  
  18511.  
  18512.  
  18513.  
  18514.  
  18515.  
  18516.                                         To:Ucs
  18517.  
  18518.  
  18519.           Function  To:Ucs ( String ) 
  18520.  
  18521.           Purpose   Convert a string to UPPER CASE.
  18522.  
  18523.           Returns   The UPPER CASE string.
  18524.  
  18525.           See Also  To:Caps, To:Lcs.
  18526.  
  18527.           Notes     Converts all characters, including initials and
  18528.                     acronyms, to UPPER CASE. Returns the resulting string.
  18529.  
  18530.  
  18531.  
  18532.  
  18533.  
  18534.  
  18535.  
  18536.  
  18537.  
  18538.  
  18539.  
  18540.  
  18541.  
  18542.  
  18543.  
  18544.  
  18545.  
  18546.  
  18547.  
  18548.  
  18549.  
  18550.  
  18551.  
  18552.  
  18553.  
  18554.  
  18555.  
  18556.  
  18557.  
  18558.  
  18559.  
  18560.  
  18561.  
  18562.  
  18563.  
  18564.  
  18565.  
  18566.  
  18567.  
  18568.           Chapter Five - JORF Functions                                 297
  18569.  
  18570.  
  18571.  
  18572.  
  18573.  
  18574.  
  18575.  
  18576.  
  18577.                                          True
  18578.  
  18579.  
  18580.           Function  True
  18581.  
  18582.           Purpose   Returns a value to indicate Logical True.
  18583.  
  18584.           Returns   A JORF Pointer to the integer 1.
  18585.  
  18586.           See Also  False.
  18587.  
  18588.           Notes     Most programming language express results of logical
  18589.                     equations as zero to indicate False, and one to
  18590.                     indicate True.  These values are called Boolean values. 
  18591.  
  18592.  
  18593.                     This function was created in the interest of program
  18594.                     clarity.  It simply returns the integer value one.
  18595.  
  18596.  
  18597.  
  18598.  
  18599.  
  18600.  
  18601.  
  18602.  
  18603.  
  18604.  
  18605.  
  18606.  
  18607.  
  18608.  
  18609.  
  18610.  
  18611.  
  18612.  
  18613.  
  18614.  
  18615.  
  18616.  
  18617.  
  18618.  
  18619.  
  18620.  
  18621.  
  18622.  
  18623.  
  18624.  
  18625.  
  18626.  
  18627.  
  18628.  
  18629.           The JORF Manual (Shareware Disk Version)                      298
  18630.  
  18631.  
  18632.  
  18633.  
  18634.  
  18635.  
  18636.  
  18637.  
  18638.                                  While/Break/Continue
  18639.  
  18640.  
  18641.           Function  While/Break/Continue
  18642.  
  18643.           Purpose   A Loop
  18644.  
  18645.           Returns   None.
  18646.  
  18647.           Notes     A loop.  Tests the value of a parameter and executes
  18648.                     indented code sections based on that value. 
  18649.  
  18650.                          While  ( TestValue ) 
  18651.                            Does indented section until false
  18652.                            Break 
  18653.                            Continue
  18654.  
  18655.                     Tests a value and does commands in indented sections
  18656.                     until that value is zero or false.  The value is often
  18657.                     a logical expression in parenthesis.
  18658.  
  18659.                     While(Ok) is commonly used to indicate a loop that will
  18660.                     be ended using the Break command.
  18661.  
  18662.                     Break ends the execution of a While.  Program flow will
  18663.                     resume on the line following the loop.
  18664.  
  18665.                     Continue ends execution of the current loop, returns
  18666.                     control to the While command to test and executed the
  18667.                     loop again if the condition remains valid.  This
  18668.                     command is used to simplify code within complex while
  18669.                     loops.  
  18670.  
  18671.  
  18672.  
  18673.  
  18674.  
  18675.  
  18676.  
  18677.  
  18678.  
  18679.  
  18680.  
  18681.  
  18682.  
  18683.  
  18684.  
  18685.  
  18686.  
  18687.  
  18688.  
  18689.  
  18690.           Chapter Five - JORF Functions                                 299
  18691.  
  18692.  
  18693.  
  18694.  
  18695.  
  18696.  
  18697.  
  18698.  
  18699.           Examples  The While statement creates a loop based on a
  18700.                     condition.  This loop is repeated as long as the
  18701.                     condition is TRUE.  A Break can be used to break out of
  18702.                     the loop even if the condition is still True.  A
  18703.                     Continue is used to shortcut the loop, restarting the
  18704.                     next iteration immediately.
  18705.  
  18706.                        Counter=0                       | Initialize Counter
  18707.                        While (++Counter <= 5)          | Increment Counter
  18708.                          Rule:Find (Rule)              | Find a next rule
  18709.                          If (Rule->Fnd=Null)           | If not found
  18710.                            Break                       |   break out of loop
  18711.                          If (Rule->Ptr=Null)           | If condition Null
  18712.                            Continue                    | Skip rest of loop
  18713.                          P=P+"-"+Rule->Pointer         | Add Pointer
  18714.                        Str:PutLine (P)                 | Show result 
  18715.  
  18716.  
  18717.  
  18718.  
  18719.  
  18720.  
  18721.  
  18722.  
  18723.  
  18724.  
  18725.  
  18726.  
  18727.  
  18728.  
  18729.  
  18730.  
  18731.  
  18732.  
  18733.  
  18734.  
  18735.  
  18736.  
  18737.  
  18738.  
  18739.  
  18740.  
  18741.  
  18742.  
  18743.  
  18744.  
  18745.  
  18746.  
  18747.  
  18748.  
  18749.  
  18750.  
  18751.           The JORF Manual (Shareware Disk Version)                      300
  18752.  
  18753.  
  18754.  
  18755.  
  18756.  
  18757.  
  18758.  
  18759.  
  18760.                                        Win:Add
  18761.  
  18762.  
  18763.           Function  Win:Add ( Title, Row, Col, Len, Wid, Level, Text ) 
  18764.                     Win:Add ( Title, Text ) 
  18765.                     Win:Add ( WindowStructure, Row, Col, Len, Wid, Level,
  18766.                     Text ) 
  18767.                     Win:Add ( WindowStructure, Text ) 
  18768.  
  18769.           Purpose   Display a new Window on the screen.
  18770.  
  18771.           Returns   None.
  18772.  
  18773.           See Also  Chapter Four, Msg:Add, Move:To, Str:Put.
  18774.  
  18775.           Notes     Without doubt, the most complicated library function.
  18776.                     WindowStructure can contain the following elements: 
  18777.  
  18778.                     Row            Top Row of Window
  18779.                     Col            Left Column of Window
  18780.                     Len            Number of rows inside window
  18781.                     Wid            Number of columns in window
  18782.                     CurRow         Cursor Row in Window
  18783.                     CurCol         Cursor Column in Window
  18784.                     MouseRow       Mouse Cursor Row in Window
  18785.                     MouseCol       Mouse Cursor Column in Window
  18786.                     RowOff         Rows that display is offset
  18787.                     ColOff         Columns that display is offset
  18788.                     InpRow         Row of Input Field
  18789.                     InpCol         Column of Input Field
  18790.                     InpLen         Length of Input Field
  18791.                     InpWid         Width of Input Field
  18792.                     Text           Text displayed in Window
  18793.                     Type           Window color or type
  18794.                     Level          Value of Here in  method that is
  18795.                                    creating the window
  18796.                     Magic          TRUE if Window interprets Magic Spots
  18797.                     Attr           Attribute 1 for low through 5 for high
  18798.                                    or color attribute
  18799.                     FLRCO          Current FLRCO value
  18800.                     Before         Method to do before window  is displayed
  18801.                     After          Method to do when window is done
  18802.                     InpBefore      Method to do before an input field is
  18803.                                    entered
  18804.                     InpAfter       Method to do after field entry is
  18805.                                    complete
  18806.  
  18807.                     A window is a box on the screen where all output and
  18808.                     input takes place.  In DOS, the sides of the box are
  18809.                     one character width wide and one character width tall. 
  18810.                     A shadow on the right side takes two character columns
  18811.  
  18812.           Chapter Five - JORF Functions                                 301
  18813.  
  18814.  
  18815.  
  18816.  
  18817.  
  18818.  
  18819.  
  18820.                     and on the bottom takes an additional character row. 
  18821.                     Under Microsoft windows, an overlapped window with wide
  18822.                     borders is displayed using your default color scheme. 
  18823.  
  18824.                     An optional title may be displayed centered in the top
  18825.                     line, and a message may be displayed in the bottom line
  18826.                     left side. 
  18827.  
  18828.                     DOS Windows use direct video access unless you specify
  18829.                     otherwise in the JORF.INI file.  DOS windows have an
  18830.                     exploding speed, which changes how the windows are
  18831.                     displayed. 
  18832.  
  18833.                     All console input and output takes place on the top
  18834.                     window displayed on the screen.  There is no facility
  18835.                     to update a window that is not the top window on the
  18836.                     screen, even under MS-Windows.  
  18837.  
  18838.                     If Title is specified, it will be displayed centered on
  18839.                     the top of the window.  If the width of the title
  18840.                     exceeds the window width specification then the window
  18841.                     width will be increased to accommodate the title. 
  18842.                     Magic spots in the title will be interpreted.
  18843.  
  18844.                     If Text is specified, the window is created exactly the
  18845.                     size of the text to be displayed.  If the text is
  18846.                     greater than the screen length or width, the window
  18847.                     will expand to the boundaries of the screen.  Commonly
  18848.                     the text attribute is passed as an indented section of
  18849.                     the program.  Any indented section is passed by the
  18850.                     interpreter as the last parameter to the command
  18851.                     preceding the indented section.  Text is required if
  18852.                     this window is to be edited using Line:Inp.
  18853.  
  18854.                     If Row and Col are specified, the position of the
  18855.                     window will be moved to the position indicated.  If
  18856.                     they are negative, then the window will be placed
  18857.                     relative to the bottom right corner of the screen.   If
  18858.                     the window dimensions do not entirely fit on the
  18859.                     screen, because Text is too large or Length too long or
  18860.                     Width too wide the Row and Col values will be changed
  18861.                     so that the window will entirely fit on the screen.
  18862.  
  18863.                     The Len (Length) and Wid (Width) parameters can be used
  18864.                     to set the exact size of the window.  These parameters
  18865.                     will override the size of Text.
  18866.  
  18867.                     The Level parameter must specify the value of here in
  18868.                     the method that creates the window.  When that method
  18869.                     is completed, the window will automatically be erased.
  18870.  
  18871.  
  18872.  
  18873.           The JORF Manual (Shareware Disk Version)                      302
  18874.  
  18875.  
  18876.  
  18877.  
  18878.  
  18879.  
  18880.  
  18881.                           Setting Window Structure Elements
  18882.  
  18883.                     When a window is created, a window structure is
  18884.                     allocated that can be referenced using Win:Ptr.  This
  18885.                     structure may contain any or all of the elements
  18886.                     referenced above.  Some of these elements, like InpRow
  18887.                     and InpCol are set by the interpreter to current
  18888.                     values. You may set others to influence the way the
  18889.                     window operates.
  18890.  
  18891.                     Structure elements may be set in two ways.  First, they
  18892.                     may be set prior to calling Win:Add by creating a
  18893.                     window structure and setting the elements normally. 
  18894.                     The second way is to set the element values directly in
  18895.                     the input definition area of the text of the window. 
  18896.                     This syntax is the same as setting up buttons and other
  18897.                     text on the window.  
  18898.  
  18899.                     CurRow and CurCol are set by the interpreter to the
  18900.                     current row and column positions of the cursor during
  18901.                     data entry.
  18902.  
  18903.                     MouseRow and MouseCol are set to the position of the
  18904.                     mouse at the time of the last button press or release.
  18905.  
  18906.                     RowOff and ColOff are set to the row and column offset
  18907.                     if the input in  the window is shifted to the left or
  18908.                     bottom.  These values are only set during input, and
  18909.                     only if the current field is shifted because the cursor
  18910.                     is too far to the left or down.
  18911.  
  18912.                     InpRow, InpCol, InpLen, and InpWid are set to the
  18913.                     appropriate values for the current data entry field.
  18914.  
  18915.                     Text is used to specify the text in the window, or to
  18916.                     define data entry fields using a text definition.  The
  18917.                     interpreter does not change this value.
  18918.  
  18919.                     Type actually changes the color mode for the window. 
  18920.                     You can set up new color sequences in the JORF.INI
  18921.                     file, and then specify them here.  That way, each type
  18922.                     of window in your application has its own colors.  
  18923.  
  18924.                     Setting Magic to False will keep the window from trying
  18925.                     to interpret magic spots (fields surrounded by {curly
  18926.                     brackets}).  Normally Magic is TRUE, and any bracket
  18927.                     expression is interpreted.
  18928.  
  18929.                     Setting Attr changes the starting attribute for text
  18930.                     display in the window.
  18931.  
  18932.  
  18933.  
  18934.           Chapter Five - JORF Functions                                 303
  18935.  
  18936.  
  18937.  
  18938.  
  18939.  
  18940.  
  18941.  
  18942.                     Setting FLRCO changes the current wrap mode.  The
  18943.                     default mode is "L" for left justified text.  
  18944.  
  18945.                     Setting Before specifies a method to be executed before
  18946.                     any data entry takes place on the window.  It can be
  18947.                     used to display additional information for the
  18948.                     operator, or to test input or display parameters.  If
  18949.                     the Before method returns FALSE, the window entry is
  18950.                     ignored.
  18951.  
  18952.                     Setting Display is similar to setting Before. The
  18953.                     difference is that the Before method executes before
  18954.                     any part of the window is displayed, but the Display
  18955.                     routine executes after the window box is showing.  The
  18956.                     Display routine can then add visual elements to the
  18957.                     window that are not included in buttons and fields that
  18958.                     make up the rest of the window definition.
  18959.  
  18960.                     Setting After specifies a method to be executed when
  18961.                     the operator attempts to exit the window using the
  18962.                     Escape key or the window close button.  On text entry
  18963.                     windows, it is common to specify a method to ask
  18964.                     whether to save the changed document before exiting the
  18965.                     window.  If the After method returns False, then the
  18966.                     window remains displayed as if the operator did not
  18967.                     request an exit.
  18968.  
  18969.                     InpBefore and InpAfter may be used to specify methods
  18970.                     that must be run before and after every input field
  18971.                     (including buttons and check boxes) in the window. 
  18972.                     These methods are commonly used to lock the record, as
  18973.                     well as qualify the operator rights to change the
  18974.                     field.  If the Before method returns False, the
  18975.                     operator will not be able to change the field.  If the
  18976.                     After method returns False, the operator will not be
  18977.                     able to move to another field (presumably until the
  18978.                     operator corrects the field value.)  
  18979.  
  18980.           Example   This first example is just a little program to show row
  18981.                     and column placement.
  18982.  
  18983.           Windows:Start
  18984.             Win:Add ("Big", 2, 2, -2, -2)
  18985.             Win:Add ("Top Right", 3, 3, 3, 15)
  18986.             Win:Add ("Bottom Right",-3, 3, 3, 15)
  18987.             Win:Add ("Bottom Left", -3, -3, 3, 15)
  18988.             Win:Add ("Top Left", 3, -3, 3, 15)
  18989.             Win:Add ("Tall", 3, 45, -4, 10)
  18990.             Win:Add ("Wide", 10, 3, 3, -4)
  18991.             Win:Pause
  18992.             Return Ok
  18993.  
  18994.  
  18995.           The JORF Manual (Shareware Disk Version)                      304
  18996.  
  18997.  
  18998.  
  18999.  
  19000.  
  19001.  
  19002.  
  19003.                     This next function CENTERED.J uses a couple commands to
  19004.                     set the window type and FLRCO mode.
  19005.  
  19006.           Centered:Start
  19007.             Win:Add (Null,0,0,7,30)
  19008.               Type:"Message"
  19009.               FLRCO:"Center"
  19010.               Button:"Ok" Row:5 Col:10 Wid:12
  19011.               This text uses a FLRCO
  19012.               command to center the
  19013.               text, and a TYPE command
  19014.               to set the window type.
  19015.             Return(Ok)
  19016.  
  19017.                     The main window in TUTORIAL.J contains menu items and
  19018.                     text.  The prompts and buttons are defined in the text
  19019.                     section.  (Sorry about the microscopic text, had
  19020.                     trouble fitting these.)
  19021.  
  19022.           Tutorial:Start
  19023.             Event:Add("Tutorial")
  19024.             Jorf:File("TutText.J")
  19025.  
  19026.             Win:Add ("Josephine's Recipe Filer Tutorial", 0, 0, 23, 78, Here.)
  19027.               Menu:"&File"
  19028.                 Menu:"E&xit         Alt-X" Action:"Jorf:Exit"
  19029.               This tutorial is {prompt:"&Hypertext", Action:"Tutorial:Box('Intro:Hyper')"}. &
  19030.               Press {Bold:"Lo"}Enter{Bold:"No"} to see the highlighted subjects. &
  19031.               Use your arrow keys to highlight different subjects.  You can &
  19032.               zoom to highlighted letters by holding the Alt key down &
  19033.               while pressing that letter.
  19034.  
  19035.               {Prompt:"&Josephine", Action:"Tutorial:Box('Intro:Jo')"}'s Recipe Filer, &
  19036.               JORF(tm), is a new computer &
  19037.               language.  JORF was created by a &
  19038.               {Prompt:"&Grunt-Programmer" Action:"Tutorial:Box('Intro:Grunt')"} &
  19039.               frustrated by low level math based computer languages &
  19040.               that are inapproprate for business data processing.  With the JORF &
  19041.               language you can easily create data entry screens,  &
  19042.               and write sophisticated routines using an Object Oriented &
  19043.               data base manager.
  19044.  
  19045.               Press "Enter" now, to read more about the Hypertext system. &
  19046.               Then, highlight the various topics and explore &
  19047.               this Tutorial.   Thank you for your support.
  19048.  
  19049.               {Group:"Hypertext Topics" Row:13 Col:4 Len:5 Wid:70}
  19050.               {Prompt:" &About the JORF Language   " Row:14 Col:08 Wid:30
  19051.           Action:"Tutorial:Box('Tut:About')"}
  19052.               {Prompt:" JORF &Programming Basics   " Row:15 Col:08 Wid:30
  19053.           Action:"Tutorial:Box('Tut:Basic')"}
  19054.  
  19055.  
  19056.           Chapter Five - JORF Functions                                 305
  19057.  
  19058.  
  19059.  
  19060.  
  19061.  
  19062.  
  19063.  
  19064.               {Prompt:" JORF Ad&vanced Programming " Row:16 Col:08 Wid:30
  19065.           Action:"Tutorial:Box('Tut:AdvStart')"}
  19066.               {Prompt:" &OOP Programming Concepts  " Row:17 Col:08 Wid:30
  19067.           Action:"Tutorial:Box('Tut:Oop')"}
  19068.               {Prompt:" JORF &Window Manager       " Row:18 Col:08 Wid:30
  19069.           Action:"Tutorial:Box('Tut:DataEntry')"}
  19070.               {Prompt:" G&etting Started with JORF " Row:14 Col:42 Wid:30
  19071.           Action:"Tutorial:Box('Write:Start')"}
  19072.               {Prompt:" &Quick Demonstration       " Row:15 Col:42 Wid:30
  19073.           Action:"Tutorial:Box('Quick:Start')"}
  19074.               {Prompt:" &Registering JORF          " Row:16 Col:42 Wid:30
  19075.           Action:"Tutorial:Regist"}
  19076.               {Prompt:" JORF Company Produc&ts     " Row:17 Col:42 Wid:30
  19077.           Action:"Tutorial:Box('Tut:Prod')"}
  19078.               {Prompt:" &Contacting JORF Company   " Row:18 Col:42 Wid:30
  19079.           Action:"Tutorial:Box('Tut:JorfCo')"}
  19080.  
  19081.               {Button:"Run &Sample Prog" Row:20 Col:2  Wid:22 Action:"Tutorial:Samples"}
  19082.               {Button:"See &Debugger"    Row:20 Col:28 Wid:22
  19083.           Action:"Kbd:Put('Ctrl_Break_Key')"}
  19084.               {Button:"E&xit"            Row:20 Col:56 Wid:22 Action:"Jorf:Exit"}
  19085.             Return (Ok)
  19086.  
  19087.                     The last example is the screen from the MAILLIST.J
  19088.                     sample program, that defines a complex window using
  19089.                     fields, buttons and boxes.
  19090.  
  19091.           MailList:Start                     | Little Mail List Program
  19092.             New (Contact:Con)                | Create Contact Structure
  19093.             Jorf:File ("CONTACT.JCM",Here)   | Set Database File to CONTACT.JCM
  19094.             Event:Add ("MailKey","Key",Here) | Set MailKey as a keystroke handler
  19095.             Mem:Ptr->IndexName = "FullName"  | Index Name
  19096.  
  19097.             | The main screen with menu options
  19098.             Win:Add ("Josephine's Mail List Manager", 2, 2, 22, 78, Here)
  19099.               Menu:"&File"
  19100.                 Menu:"&About            "  Action:"MailList:About"
  19101.                 Menu:
  19102.                 Menu:"&Rebuild        ",   Action:"Jorf:Rebuild"
  19103.                 Menu:
  19104.                 Menu:"E&xit        Alt-X", Action:"MailKey:Esc_Key"
  19105.  
  19106.               Menu:"&Edit"
  19107.                 Menu:"&Add     Alt-A", Action:"MailList:Add(Con)"    HotKey:"Alt_A_Key"
  19108.                 Menu:"&Change  Alt-C", Action:"MailList:Change(Con)"
  19109.                 Menu:"&Delete  Alt-D", Action:"MailList:Delete(Con)" HotKey:"Alt_D_Key"
  19110.  
  19111.               Menu:"&Search",
  19112.                 Menu:"&Name       ",  Action:"MailList:KeySearch (Con, 'FullName' )
  19113.                 Menu:"&Company    ",  Action:"MailList:KeySearch (Con, 'Company'  )
  19114.                 Menu:"&Last Name  ",  Action:"MailList:KeySearch (Con, 'LastName' )
  19115.                 Menu:"&Phone      ",  Action:"MailList:KeySearch (Con, 'WorkPhone')
  19116.  
  19117.           The JORF Manual (Shareware Disk Version)                      306
  19118.  
  19119.  
  19120.  
  19121.  
  19122.  
  19123.  
  19124.  
  19125.                 Menu:"&Zip        ",  Action:"MailList:KeySearch (Con, 'ZipCode'  )
  19126.  
  19127.               Menu:"&Reports"
  19128.                 Menu:"&Mail List    ", Action:"MailList:List()"
  19129.                 Menu:"&This Contact ", Action:"MailList:PrintData(Con)"
  19130.                 Menu:"&Lotsa Labels ", Action:"MailList:ContinLabels(Con,'All')"
  19131.                 Menu:"&One Label",     Action:"MailList:ContinLabels(Con,'One')"
  19132.  
  19133.               InpBefore:"MailList:Lock(Con)"
  19134.               Group:"&Browse List", Row:1 Col:41, Len:6, Wid:36
  19135.               List:""
  19136.                 Field:"Con"
  19137.                 Next:"MailList:NextRecord(Con,'Next')"
  19138.                 Prev:"MailList:NextRecord(Con,'Prev')"
  19139.                 Show:"MailList:Show(Con)"
  19140.                 Before:"MailList:Write()"
  19141.                 Display:"(Mem:Ptr->Locked==Null)"
  19142.  
  19143.               Group:"&Contact Name and Address", Row:1, Col:1, Wid:38, Len:6
  19144.               Input:"Name   ",    Wid:30, Field:"Con->FullName"
  19145.                 After:"MailList:SplitName(Con)"
  19146.               Input:"Company", Wid:30,    Field:"Con->Company"
  19147.               Input:"Address", Wid:30,    Field:"Con->Addr1"
  19148.               Input:"       ", Wid:30,    Field:"Con->Addr2"
  19149.               Input:"       ", Wid:30,    Field:"Con->Addr3"
  19150.                 After:"MailList:ZipCode(Con)"
  19151.  
  19152.               Group:"Mail List Fields"
  19153.                 Row:9  Col:1  Len:11  Wid:76
  19154.               Input:"&Work Phone" Field:"Con->WorkPhone"
  19155.                 Row:10  Col:2  Wid:20
  19156.               Input:"&Home Phone"  Field:"Con->Homephone"
  19157.                 Row:11  Col:2  Wid:20
  19158.               Input:"Fax &Phone " Field:"Con->FaxPhone"
  19159.                 Row:12  Col:2  Wid:20
  19160.               Input:"Birthda&y  " Field:"Con->BirthDay"
  19161.                 Row:13  Col:2  Wid:20
  19162.               Input:"C&omment   "  Field:"Con->Comment"
  19163.                 Row:15  Col:2  Wid:50
  19164.               Input:"&Last Name " Field:"Con->LastName"
  19165.                 Row:10  Col:35  Wid:14
  19166.               Input:"Dear      " Field:"Con->Dear"
  19167.                 Row:11  Col:35  Wid:14
  19168.               Input:"Zip Code  " Field:"Con->Zipcode"
  19169.                 Row:12  Col:35  Wid:14
  19170.               Radio:"Fr&iend"
  19171.                 Check:"Con->Type=='Friend'"
  19172.                 Action:"Con->Type='Friend'"
  19173.                 UnAction:"Con->Type= Null"
  19174.                 Row:10  Col:62
  19175.               Radio:"Fa&mily"
  19176.                 Check:"Con->Type=='Family'"
  19177.  
  19178.           Chapter Five - JORF Functions                                 307
  19179.  
  19180.  
  19181.  
  19182.  
  19183.  
  19184.  
  19185.  
  19186.                 Action:"Con->Type='Family'"
  19187.                 UnAction:"Con->Type= Null"
  19188.                 Row:11  Col:62
  19189.               Radio:"Clien&t"
  19190.                 Check:"Con->Type=='Client'"
  19191.                 Action:"Con->Type='Client'"
  19192.                 UnAction:"Con->Type= Null"
  19193.                 Row:12  Col:62
  19194.               Radio:"&Vendor"
  19195.                 Check:"Con->Type=='Vendor'"
  19196.                 Action:"Con->Type='Vendor'"
  19197.                 UnAction:"Con->Type= Null"
  19198.                 Row:13  Col:62
  19199.               HLine:"&Notes"
  19200.                 Row:16  Col:2  Len:1  Wid:76
  19201.               Text:"" Field:"Con->Notes"
  19202.                 Row:17  Col:2  Len:4  Wid:76
  19203.             Return (Ok)                         | That is all, Folks!
  19204.  
  19205.  
  19206.  
  19207.  
  19208.  
  19209.  
  19210.  
  19211.  
  19212.  
  19213.  
  19214.  
  19215.  
  19216.  
  19217.  
  19218.  
  19219.  
  19220.  
  19221.  
  19222.  
  19223.  
  19224.  
  19225.  
  19226.  
  19227.  
  19228.  
  19229.  
  19230.  
  19231.  
  19232.  
  19233.  
  19234.  
  19235.  
  19236.  
  19237.  
  19238.  
  19239.           The JORF Manual (Shareware Disk Version)                      308
  19240.  
  19241.  
  19242.  
  19243.  
  19244.  
  19245.  
  19246.  
  19247.  
  19248.                                        Win:Attr
  19249.  
  19250.  
  19251.           Function  Win:Attr ( Attribute ) 
  19252.  
  19253.           Purpose   Sets attribute for text in a window.
  19254.  
  19255.           Returns   None.
  19256.  
  19257.           Notes     Whenever anyone in the IBM PC world says Attribute, you
  19258.                     know they are talking about colors on the monitor. 
  19259.                     This command sets the colors for text to be displayed.
  19260.  
  19261.                     The attribute may be "Hi" for highlighted text, "Low"
  19262.                     for low highlight.  You can also set one of five values
  19263.                     for attribute, 1 corresponds to normal, through 5 for
  19264.                     high. 
  19265.  
  19266.                     Number         INI  Name What it is used for
  19267.  
  19268.                     1    Normal    Normal text and field display
  19269.                     2    Low       Highlighted letters in field/menu display
  19270.                     3    Medium    Box and Graphic lines
  19271.                     4    High      Fields not selected, selected menu item
  19272.                     5    Bold      Selected fields, Selected Menu item letter
  19273.  
  19274.  
  19275.                     Version 2.1 introduces the ability to set any color
  19276.                     using attribute numbers.  Colors on a PC are expressed
  19277.                     using a background and foreground color.  The
  19278.                     background is the base screen color, and the foreground
  19279.                     will be the color of the letters on the background. 
  19280.                     When expressed in this way, you can use the IBM
  19281.                     attribute numbers or you can use JORF names for those
  19282.                     colors.
  19283.  
  19284.  
  19285.  
  19286.  
  19287.  
  19288.  
  19289.  
  19290.  
  19291.  
  19292.  
  19293.  
  19294.  
  19295.  
  19296.  
  19297.  
  19298.  
  19299.  
  19300.           Chapter Five - JORF Functions                                 309
  19301.  
  19302.  
  19303.  
  19304.  
  19305.  
  19306.  
  19307.  
  19308.  
  19309.                          JORF Color Name          Number
  19310.                          Black          0
  19311.                          Blue           1
  19312.                          Green          2
  19313.                          Cyan           3
  19314.                          Red            4
  19315.                          Magenta        5
  19316.                          Brown          6
  19317.                          White          7    (Actually light gray)
  19318.                          Gray           8    (Actually dark gray)
  19319.                          Light Blue     9
  19320.                          Light Green    10
  19321.                          Light Cyan     11
  19322.                          Light Red      12
  19323.                          Light Magenta  13
  19324.                          Yellow         14
  19325.                          Bright White   15   (Actually white)
  19326.  
  19327.                     When setting attributes, the colors are expressed as a
  19328.                     pair separated by a slash.  The first color represents
  19329.                     the foreground, and the second is the background
  19330.                     colors.  The following two commands are equivalent and
  19331.                     will change the color to use white text on a blue
  19332.                     background:
  19333.  
  19334.                          Win:Attr("Bright White/Blue")
  19335.                          Win:Attr("15/1")
  19336.  
  19337.  
  19338.                     You can set attribute without using this command by
  19339.                     setting Win:Ptr->Attr = Attribute.  
  19340.  
  19341.                          Win:Ptr->Attr="Bright White/Blue"
  19342.  
  19343.  
  19344.           Example   The Colors.J sample program shows all possible colors.
  19345.  
  19346.           Colors:Start
  19347.             New(I)
  19348.             Win:Add ("Color Demonstration", 0, 0, 16, (16*4), Here)
  19349.             For (i=0 thru 255)
  19350.               Win:Attr((i%16)+"/"+Num:Int(i/16))
  19351.               Str:Put(To:Str(i," ###"))
  19352.               If ((I%16)==15)
  19353.                 Str:PutLine()
  19354.             Win:Pause
  19355.             Return (Ok)
  19356.  
  19357.  
  19358.  
  19359.  
  19360.  
  19361.           The JORF Manual (Shareware Disk Version)                      310
  19362.  
  19363.  
  19364.  
  19365.  
  19366.  
  19367.  
  19368.  
  19369.  
  19370.                                       Win:Block
  19371.  
  19372.  
  19373.           Function  Win:Block ( Function, Command )  
  19374.  
  19375.           Purpose   Do some WordStar style block commands.
  19376.  
  19377.           Returns   None.
  19378.  
  19379.           Notes     JORF Version 2.0 introduces the same Block Move and
  19380.                     Copy commands found in other Wordstar style editors. 
  19381.                     You can access these functions using Win:Block.  
  19382.  
  19383.                     Win:Block ("Mark", Marker).  Places a block marker. 
  19384.                     Marker can be a number from 0 through 9, "Beginning" or
  19385.                     "End".
  19386.  
  19387.                     Win:Block ("Goto", Marker).  Move cursor to a block
  19388.                     marker.  Marker can be a number from 0 through 9,
  19389.                     "Beginning" or "End".
  19390.  
  19391.                     Win:Block ("Copy").  Copies a marked block to current
  19392.                     cursor location.  Nothing is copied if block is not
  19393.                     correctly marked, or if cursor is within the block.
  19394.  
  19395.                     Win:Block ("Delete", Marker).  Delete the marked block,
  19396.                     no matter where the cursor is located. 
  19397.  
  19398.                     Win:Block ("Move").  Moves a marked block by copying it
  19399.                     to the current cursor location and then deleting it
  19400.                     from its prior location.
  19401.  
  19402.                     Win:Block ("Read", FileName).  Reads a block from disk
  19403.                     into the current cursor location.  File is assumed to
  19404.                     be a text file.  This read adds lines one by one, and
  19405.                     is much slower than File:Load.
  19406.  
  19407.                     Win:Block ("Write" FileName).  Writes a marked block to
  19408.                     disk.  Does not change block markers.
  19409.  
  19410.  
  19411.  
  19412.  
  19413.  
  19414.  
  19415.  
  19416.  
  19417.  
  19418.  
  19419.  
  19420.  
  19421.  
  19422.           Chapter Five - JORF Functions                                 311
  19423.  
  19424.  
  19425.  
  19426.  
  19427.  
  19428.  
  19429.  
  19430.  
  19431.                                        Win:Chg
  19432.  
  19433.  
  19434.           Function  Win:Chg ( Marker, NewFields )  
  19435.                     Win:Chg ( Marker, Row, Col, Len, Wid, NewFields )  
  19436.  
  19437.           Purpose   Change the fields in a window for something new. 
  19438.  
  19439.           Returns   None.
  19440.  
  19441.           Notes     This command will make your windows sing.  Use it to
  19442.                     redraw sections of a window based on data entry by the
  19443.                     operator.  This function dynamically reallocates and
  19444.                     re-displays a portion of a window.
  19445.  
  19446.                     The key to using this command is to use Marker commands
  19447.                     in your definition.  When a group of fields is preceded
  19448.                     by a marker, they can be changed simply by referencing
  19449.                     that marker.  Each marker section of fields goes until
  19450.                     the next marker.  Markers cannot be nested.
  19451.  
  19452.                     If you call this command with Row, Col, Len and Wid,
  19453.                     then the section of the screen is physically erased and
  19454.                     redrawn.  This is the common way to display window
  19455.                     changes.  If the changes are so minor that the screen
  19456.                     does not need to be redrawn, then you can use the short
  19457.                     form of this function.
  19458.  
  19459.           Example   See Contact.J.
  19460.  
  19461.  
  19462.  
  19463.  
  19464.  
  19465.  
  19466.  
  19467.  
  19468.  
  19469.  
  19470.  
  19471.  
  19472.  
  19473.  
  19474.  
  19475.  
  19476.  
  19477.  
  19478.  
  19479.  
  19480.  
  19481.  
  19482.  
  19483.           The JORF Manual (Shareware Disk Version)                      312
  19484.  
  19485.  
  19486.  
  19487.  
  19488.  
  19489.  
  19490.  
  19491.  
  19492.                                        Win:Del
  19493.  
  19494.  
  19495.           Function  Win:Del
  19496.  
  19497.           Purpose   Delete top window on screen.
  19498.  
  19499.           Returns   None.
  19500.  
  19501.           See Also  Win:Add.
  19502.  
  19503.           Notes     Deletes a single window on the screen.    This command
  19504.                     is not generally used because windows are deleted
  19505.                     automatically when the method that creates them is
  19506.                     complete.
  19507.  
  19508.           Example   See Arr:Len.
  19509.  
  19510.  
  19511.  
  19512.  
  19513.  
  19514.  
  19515.  
  19516.  
  19517.  
  19518.  
  19519.  
  19520.  
  19521.  
  19522.  
  19523.  
  19524.  
  19525.  
  19526.  
  19527.  
  19528.  
  19529.  
  19530.  
  19531.  
  19532.  
  19533.  
  19534.  
  19535.  
  19536.  
  19537.  
  19538.  
  19539.  
  19540.  
  19541.  
  19542.  
  19543.  
  19544.           Chapter Five - JORF Functions                                 313
  19545.  
  19546.  
  19547.  
  19548.  
  19549.  
  19550.  
  19551.  
  19552.  
  19553.                                        Win:Dsp
  19554.  
  19555.  
  19556.           Function  Win:Dsp
  19557.  
  19558.           Purpose   Signal a redisplay of all windows.
  19559.  
  19560.           Returns   None.
  19561.  
  19562.           See Also  Win:Add.
  19563.  
  19564.           Notes     Signals to the interpreter that all data entry windows
  19565.                     should be redisplayed, presumably because data
  19566.                     displayed in the window may have changed.  
  19567.  
  19568.                     During data entry, changes to the current field are
  19569.                     made by the operator.  Other fields, however, may have
  19570.                     values that have changed because of the entry.  Win:Dsp
  19571.                     forces all fields to be redisplayed, so that any
  19572.                     changed values will be shown.
  19573.  
  19574.                     Changes on one window  may affect the display of a
  19575.                     prior window.  For this reason Win:Dsp sends the signal
  19576.                     to all windows.
  19577.  
  19578.                     Windows are redisplayed during the "Idle" cycle.  This
  19579.                     happens about one second after the system begins to
  19580.                     wait for data entry from the operator.  If the operator
  19581.                     has typed ahead, then the system does not go Idle and
  19582.                     the redisplay process waits until the current task is
  19583.                     complete.
  19584.  
  19585.           Example   See MAILLIST.J.
  19586.  
  19587.  
  19588.  
  19589.  
  19590.  
  19591.  
  19592.  
  19593.  
  19594.  
  19595.  
  19596.  
  19597.  
  19598.  
  19599.  
  19600.  
  19601.  
  19602.  
  19603.  
  19604.  
  19605.           The JORF Manual (Shareware Disk Version)                      314
  19606.  
  19607.  
  19608.  
  19609.  
  19610.  
  19611.  
  19612.  
  19613.  
  19614.                                       Win:FLRCO
  19615.  
  19616.  
  19617.           Function  Win:FLRCO ( Mode ) 
  19618.  
  19619.           Purpose   Change wrap mode for text on the window.
  19620.  
  19621.           Returns   Previous wrap mode as a string containing a single
  19622.                     lower case letter "f", "l", "r", "c" or "o".
  19623.  
  19624.           See Also  Win:Add.
  19625.  
  19626.           Notes     Sets the current window mode for text justification. 
  19627.                     The name of this command comes from the possible Modes;
  19628.                     "Full", "Left", "Right", "Center", or "Off".  "Off"
  19629.                     turns off the text wrapping feature so text that
  19630.                     overflows the window boundary will not be displayed. 
  19631.                     The other modes all turn on the wrapping feature that
  19632.                     wraps text at the nearest word boundary.
  19633.  
  19634.                     You can set FLRCO without using this command by setting
  19635.                     Win:Ptr->FLRCO = "F" (or "L" or "R" or "C" or "O". 
  19636.                     This is now the preferred method for setting FLRCO, and
  19637.                     the command may be eliminated in later versions of
  19638.                     JORF.
  19639.  
  19640.           Example   The CENTERED.J file uses a FLRCO command to set the
  19641.                     justification mode to "Centered".
  19642.  
  19643.           Centered:Start
  19644.             Win:Add (Null,0,0,7,30)
  19645.               Type:"Message"
  19646.               FLRCO:"Center"
  19647.               Button:"Ok" Row:5 Col:10 Wid:12
  19648.               This text uses a FLRCO
  19649.               command to center the
  19650.               text, and a TYPE command
  19651.               to set the window type.
  19652.             Return(Ok)
  19653.  
  19654.  
  19655.  
  19656.  
  19657.  
  19658.  
  19659.  
  19660.  
  19661.  
  19662.  
  19663.  
  19664.  
  19665.  
  19666.           Chapter Five - JORF Functions                                 315
  19667.  
  19668.  
  19669.  
  19670.  
  19671.  
  19672.  
  19673.  
  19674.  
  19675.                                       Win:Magic
  19676.  
  19677.  
  19678.           Function  Win:Magic ( Mode ) 
  19679.  
  19680.           Purpose   Change whether curly brackets are interpreted in text
  19681.                     on the window.
  19682.  
  19683.           Returns   Previous Magic mode True or False. 
  19684.  
  19685.           See Also  Win:Add.
  19686.  
  19687.           Notes     Sets the mode for "Magic", whether {curly bracket}
  19688.                     expressions are interpreted in text display.  Usually
  19689.                     this mode is True, allowing all variable values and
  19690.                     input expressions to be interpreted.  However, when
  19691.                     editing commands or program text, you want this mode
  19692.                     off so the that curly brackets are not interpreted. 
  19693.  
  19694.                     You also want to set FLRCO "Off" to editing program
  19695.                     text. Otherwise text lines will wrap at the window
  19696.                     borders.
  19697.  
  19698.                     Astute programmers may note that variables in windows
  19699.                     are replaced, even when they are not in the current
  19700.                     method.  The "Magic" system looks down the entire stack
  19701.                     for a named variable, and is not limited by the current
  19702.                     method which may just display the window.  
  19703.  
  19704.                     You can set Magic without using this command by setting
  19705.                     Win:Ptr->Magic = True (or False).  This is now the
  19706.                     preferred method for setting Magic, and the command may
  19707.                     be eliminated in later versions of JORF.
  19708.  
  19709.  
  19710.  
  19711.  
  19712.  
  19713.  
  19714.  
  19715.  
  19716.  
  19717.  
  19718.  
  19719.  
  19720.  
  19721.  
  19722.  
  19723.  
  19724.  
  19725.  
  19726.  
  19727.           The JORF Manual (Shareware Disk Version)                      316
  19728.  
  19729.  
  19730.  
  19731.  
  19732.  
  19733.  
  19734.  
  19735.  
  19736.                                        Win:Msg
  19737.  
  19738.  
  19739.           Function  Win:Msg ( Message ) 
  19740.  
  19741.           Purpose   Display a message in the Window.
  19742.  
  19743.           Returns   None.
  19744.  
  19745.           See Also  Win:Add.
  19746.  
  19747.           Notes     Displays a message in the last line of the current
  19748.                     window.  If the message is absent or null then the
  19749.                     current message is deleted. 
  19750.  
  19751.                     This command acts slightly differently under MS-DOS and
  19752.                     MS-Windows.  Under DOS, the message is placed in the
  19753.                     bottom border of the window.  Under Windows, it didn't
  19754.                     look good, so as an alternative  Win:Msg expands the
  19755.                     window by one line and displays the message on the new
  19756.                     line of the window.
  19757.           Example
  19758.  
  19759.           CharEx:Start
  19760.             New (Count, Str1, Str2)
  19761.             Str1="This Text will Disappear"
  19762.             Str2="This Text will Appear"
  19763.             Win:Add ("Char Example", 10, 25, 2, 30, Here)
  19764.             Str:Put (Str1)          | Show Str1
  19765.             Win:Msg ("Press Enter to continue...")
  19766.             Win:Pause               | And pause for Effect
  19767.             Win:Msg                 |
  19768.             Count = Str:Len (Str1)  | Set Counter
  19769.             While (Count > 0)       | While GT Zero
  19770.               Move:To (1,1)         |   First line
  19771.               Char:Del (1)          |   Take 1 Away
  19772.               Move:To (2,1)         |   Second line
  19773.               Char:Ins (1)          |   Add one, Add char
  19774.               Char:Put (To:Ascii (Str:At (Str2, Count, 1)))
  19775.               --Count               |   Decrement Count
  19776.               Win:Pause(5)          |   Pause 5/100 seconds
  19777.             Win:Msg("Press Enter to continue...")
  19778.             Win:Pause               | Done!
  19779.             Return                  | Bye
  19780.  
  19781.  
  19782.  
  19783.  
  19784.  
  19785.  
  19786.  
  19787.  
  19788.           Chapter Five - JORF Functions                                 317
  19789.  
  19790.  
  19791.  
  19792.  
  19793.  
  19794.  
  19795.  
  19796.  
  19797.                                       Win:Pause
  19798.  
  19799.  
  19800.           Function  Win:Pause ( Hundredths ) 
  19801.  
  19802.           Purpose   Pause.
  19803.  
  19804.           Returns   The Key that was hit, if one was hit, to end the pause.
  19805.  
  19806.           See Also  Kbd:Get.
  19807.  
  19808.           Notes     Pauses for the specified number of Hundredths of
  19809.                     seconds.  Due to the quirky hardware engineering of an
  19810.                     IBM PC, exact Hundredths are a basic unit, but cannot
  19811.                     be obtained by a program.  Generally, the finest
  19812.                     resolution is about three hundredths of a second at a
  19813.                     time.  Anyway, this command will pause as close as it
  19814.                     can get to the hundredths you specified.
  19815.  
  19816.                     If the operator hits any key, the pause will end.  If
  19817.                     Hundredths is zero, the pause will continue
  19818.                     indefinitely.  If the pause is greater than 5 seconds,
  19819.                     a "Happy Goat" will be displayed. 
  19820.  
  19821.           Example   This example is the much reviled SayLineByCharacter
  19822.                     method that is used in the tutorial for program
  19823.                     scripts.
  19824.  
  19825.                     Script:SayLineByCharacter (j)
  19826.                       New (I, C)               | Create new vars I and C 
  19827.                       I=1                      | Start with 1
  19828.                       While (Ok)
  19829.                         C=Str:At(J, I, 1)      | Get Character
  19830.                         If (C==Null)           | Done?
  19831.                           Break
  19832.                         Str:Put (C)            | Put it
  19833.                         ++I                    | Next Character
  19834.                         Win:Pause (1)          | Pause a hundredth 
  19835.                       Str:PutLine()            | Carriage Return (Putting null line)
  19836.  
  19837.  
  19838.  
  19839.  
  19840.  
  19841.  
  19842.  
  19843.  
  19844.  
  19845.  
  19846.  
  19847.  
  19848.  
  19849.           The JORF Manual (Shareware Disk Version)                      318
  19850.  
  19851.  
  19852.  
  19853.  
  19854.  
  19855.  
  19856.  
  19857.  
  19858.                                        Win:Ptr
  19859.  
  19860.  
  19861.           Function  Win:Ptr
  19862.  
  19863.           Purpose   Get the Structure that was used to create the window.
  19864.  
  19865.           Returns   A pointer to the Structure that was used to create the
  19866.                     window.  
  19867.  
  19868.           See Also  Win:Add.
  19869.  
  19870.           Notes     It is common to need information about the current
  19871.                     window from within methods that check and display
  19872.                     information for the window.  The most important vehicle
  19873.                     for this information is this function.  By using
  19874.                     Win:Ptr you have access to more than a dozen fields
  19875.                     including row, column, length and width of the window,
  19876.                     row, column, length and width of the current edit
  19877.                     field, mouse position and status, current attribute and
  19878.                     the value of the current input.
  19879.  
  19880.                     Win:Ptr->Row, Win:Ptr->Column, Win:Ptr->Len and
  19881.                     Win:Ptr->Wid reflect the actual window, and may have
  19882.                     changed if the window was adjusted to fit on the
  19883.                     screen.  (This is one way to see if the user is in
  19884.                     EGA/VGA 43/50 line mode by creating a window with a
  19885.                     length of -1 and then testing Win:Ptr->Len to get the
  19886.                     actual last line of the screen).
  19887.  
  19888.                     If you are editing a field or text, Win:Ptr->CurRow and
  19889.                     Win:Ptr->CurCol will be set to the cursor row and
  19890.                     column.  Win:Ptr->CurLine will be set to the current
  19891.                     input value.  If the mouse pointer is inside the window
  19892.                     Win:Ptr->MouseRow and Win:Ptr->MouseCol are set to
  19893.                     current mouse position.
  19894.  
  19895.                     If the current input field is more than one line (a
  19896.                     text input), Magic is False, and FLRCO is "Off", then
  19897.                     the window can move right or down to accommodate text
  19898.                     that is larger than the window.  In this case
  19899.                     Win:Ptr->RowOff and Win:Ptr->ColOff reflect the
  19900.                     relative position of the top left corner of the text in
  19901.                     the window.
  19902.  
  19903.                     You can test and set Win:Ptr->FLRCO, Win:Ptr->Magic and
  19904.                     Win:Ptr->Attr.  When these values are assigned, the
  19905.                     interpreter automatically calls the appropriate
  19906.                     function. 
  19907.  
  19908.  
  19909.  
  19910.           Chapter Five - JORF Functions                                 319
  19911.  
  19912.  
  19913.  
  19914.  
  19915.  
  19916.  
  19917.  
  19918.  
  19919.                                        Win:Repl
  19920.  
  19921.  
  19922.           Function  Win:Repl ( SearchString, ReplaceString, Flags ) 
  19923.  
  19924.           Purpose   Do some WordStar style string replacing commands.
  19925.  
  19926.           Returns   None.
  19927.  
  19928.           See Also  Win:Search.
  19929.  
  19930.           Notes     The JORF Window Manager uses the same Search and
  19931.                     Replace commands found in other WordStar style editors. 
  19932.                     You can access these functions using Win:Search and
  19933.                     Win:Repl.  
  19934.  
  19935.                     Flag values are:
  19936.  
  19937.                     B    Search backward to top - Normally searches forwards.
  19938.                     G    Global replace - Normally replaces just one. 
  19939.                     N    Do not prompt - Normally prompts for each replace.
  19940.                     U    Case insensitive search - Normally is case sensitive.
  19941.                     W    Search for Whole Words - Normally allows partial words.
  19942.  
  19943.                     A numeric value with the flags is considered the number
  19944.                     of items to skip before stopping.  For instance, GU2
  19945.                     will search globally, without case sensitivity, and
  19946.                     will replace two instances of the item.
  19947.  
  19948.                     This command can only be used within an edit window,
  19949.                     and will do nothing if used on a text that is not
  19950.                     currently being edited in the window.
  19951.  
  19952.  
  19953.  
  19954.  
  19955.  
  19956.  
  19957.  
  19958.  
  19959.  
  19960.  
  19961.  
  19962.  
  19963.  
  19964.  
  19965.  
  19966.  
  19967.  
  19968.  
  19969.  
  19970.  
  19971.           The JORF Manual (Shareware Disk Version)                      320
  19972.  
  19973.  
  19974.  
  19975.  
  19976.  
  19977.  
  19978.  
  19979.  
  19980.                                       Win:Search
  19981.  
  19982.  
  19983.           Function  Win:Search ( SearchString, Flags ) 
  19984.  
  19985.           Purpose   Do some WordStar style string search. 
  19986.  
  19987.           Returns   None.
  19988.  
  19989.           See Also  Win:Repl.
  19990.  
  19991.           Notes     The JORF Window Manager uses introduces the same Search
  19992.                     and Replace commands found in other Wordstar style
  19993.                     editors.  You can access these functions using
  19994.                     Win:Search and Win:Repl.  
  19995.  
  19996.                     Flag values are:
  19997.  
  19998.                     B    Search backward to top - Normally searches forwards.
  19999.                     U    Case insensitive search - Normally is case sensitive.
  20000.                     W    Search for Whole Words - Normally allows partial words.
  20001.  
  20002.                     A numeric value with the flags is considered the number
  20003.                     of items to skip before stopping.  For instance, GU2
  20004.                     will search globally, without case sensitivity, and
  20005.                     will stop on the second instance of the search item.
  20006.  
  20007.                     This command can only be used within an edit window,
  20008.                     and will do nothing if used on a text that is not
  20009.                     currently being edited in the window.
  20010.  
  20011.  
  20012.  
  20013.  
  20014.  
  20015.  
  20016.  
  20017.  
  20018.  
  20019.  
  20020.  
  20021.  
  20022.  
  20023.  
  20024.  
  20025.  
  20026.  
  20027.  
  20028.  
  20029.  
  20030.  
  20031.  
  20032.           Chapter Five - JORF Functions                                 321
  20033.  
  20034.  
  20035.  
  20036.  
  20037.  
  20038.  
  20039.  
  20040.  
  20041.                                        Word:At
  20042.  
  20043.  
  20044.           Function  Word:At ( Structure, Position ) 
  20045.  
  20046.           Purpose   Returns a word in parsed command line, or value of a
  20047.                     member of a structure. 
  20048.  
  20049.           Returns   Word.
  20050.  
  20051.           See Also  Word:AtPut, Class:At.
  20052.  
  20053.           Notes     Both structures and text lines are stored as an array
  20054.                     of Class:Word pairs.  The number of words can be
  20055.                     obtained using Word:Len.
  20056.  
  20057.                                         Arrays
  20058.  
  20059.                     Array elements are normally accessed using square
  20060.                     brackets [].  But if you find reason, you can use
  20061.                     Word:At to get the element. Word:Len-1 will be the
  20062.                     number of elements used in the array. 
  20063.  
  20064.                                       Structures
  20065.  
  20066.                     Normally, structure elements are accessed using
  20067.                     pointers.  However, they may also be accessed by
  20068.                     referencing the elements directly using this command. 
  20069.                     This has to be done to examine the stack, because it is
  20070.                     not a normal class. 
  20071.  
  20072.                                          Text
  20073.  
  20074.                     Text lines may be examined to obtain the class and
  20075.                     values of items on that line.  The line is
  20076.                     automatically parsed when Word:At is used.  Unlike the
  20077.                     parse used by the interpreter, the Word:At parse
  20078.                     separates all punctuation characters into individual
  20079.                     words, even if they are two character symbols like the
  20080.                     pointer->operator.
  20081.  
  20082.           Example   See Event:Add.
  20083.  
  20084.  
  20085.  
  20086.  
  20087.  
  20088.  
  20089.  
  20090.  
  20091.  
  20092.  
  20093.           The JORF Manual (Shareware Disk Version)                      322
  20094.  
  20095.  
  20096.  
  20097.  
  20098.  
  20099.  
  20100.  
  20101.  
  20102.                                       Word:AtDel
  20103.  
  20104.  
  20105.           Function  Word:AtDel ( Structure, Position, Count ) 
  20106.  
  20107.           Purpose   Squeezes a structure.
  20108.  
  20109.           Returns   None.
  20110.  
  20111.           See Also  Word:At, Word:AtIns, Str:AtDel.
  20112.  
  20113.           Notes     Squeezes elements out of the center of a structure. 
  20114.                     Unlike Word:At, Word:AtDel and Word:AtIns delete and
  20115.                     insert the Class/Word pair, so there is no need for the
  20116.                     equivalent Class:AtDel and Class:AtIns  functions.   If
  20117.                     the Count argument is missing then all elements of the
  20118.                     structure starting at Position are deleted.
  20119.  
  20120.                                         Arrays
  20121.  
  20122.                     This function cannot be used on arrays.
  20123.  
  20124.                                       Structures
  20125.  
  20126.  
  20127.                     Deleting "Word" values will eliminate structure
  20128.                     elements.  Care should be taken not to delete more than
  20129.                     you intend.  Each structure may have elements in a
  20130.                     different order, even when the structures are from the
  20131.                     same class.  That is because elements are kept in the
  20132.                     order assigned, and assignment may be arbitrary.
  20133.  
  20134.                     You should never delete the first element of a
  20135.                     structure, because this affects the class of the
  20136.                     structure.
  20137.  
  20138.                                          Text
  20139.  
  20140.                     This function has no effect on lines of text.
  20141.  
  20142.  
  20143.  
  20144.  
  20145.  
  20146.  
  20147.  
  20148.  
  20149.  
  20150.  
  20151.  
  20152.  
  20153.  
  20154.           Chapter Five - JORF Functions                                 323
  20155.  
  20156.  
  20157.  
  20158.  
  20159.  
  20160.  
  20161.  
  20162.  
  20163.                                       Word:AtIns
  20164.  
  20165.  
  20166.           Function  Word:AtIns ( Structure, Position, Count ) 
  20167.  
  20168.           Purpose   Expands a structure.
  20169.  
  20170.           Returns   None.
  20171.  
  20172.           See Also  Word:At, Word:AtDel, Str:AtIns.
  20173.  
  20174.           Notes     Inserts elements out of the center of a structure. 
  20175.                     Unlike Word:At, Word:AtDel and Word:AtIns delete and
  20176.                     insert the Class/Word pair, so there is no need for the
  20177.                     equivalent Class:AtDel and Class:AtIns  functions. If
  20178.                     the Count argument is missing then the structure
  20179.                     remains unchanged.
  20180.  
  20181.                                         Arrays
  20182.  
  20183.                     This function cannot be used on arrays.
  20184.  
  20185.                                       Structures
  20186.  
  20187.                     After inserting, you must use Class:AtPut and
  20188.                     Word:AtPut to set the Class/Word values.  
  20189.  
  20190.                     Care should be taken not to insert at position 1,
  20191.                     because the first pair contains the class name for the
  20192.                     structure.
  20193.  
  20194.                                          Text
  20195.  
  20196.                     This command has no effect on lines of text.
  20197.  
  20198.  
  20199.  
  20200.  
  20201.  
  20202.  
  20203.  
  20204.  
  20205.  
  20206.  
  20207.  
  20208.  
  20209.  
  20210.  
  20211.  
  20212.  
  20213.  
  20214.  
  20215.           The JORF Manual (Shareware Disk Version)                      324
  20216.  
  20217.  
  20218.  
  20219.  
  20220.  
  20221.  
  20222.  
  20223.  
  20224.                                       Word:AtPut
  20225.  
  20226.  
  20227.           Function  Word:AtPut ( Structure, Position, Value ) 
  20228.  
  20229.           Purpose   Changes the value in a member of a structure. 
  20230.  
  20231.           Returns   None.
  20232.  
  20233.           See Also  Word:At, Class:AtPut.
  20234.  
  20235.           Notes     Both structures and text lines are stored as an array
  20236.                     of Class:Word pairs.  You can use this function to
  20237.                     change the "Word" portion of such a structure. The
  20238.                     number of words in a structure or line can be obtained
  20239.                     using Word:Len.  
  20240.  
  20241.                                         Arrays
  20242.  
  20243.                     This function cannot be used on arrays.
  20244.  
  20245.                                       Structures
  20246.  
  20247.                     Replacing a "Word" value will not change the length of
  20248.                     the structure.  You should not replace the first word
  20249.                     of the structure, unless you are intentionally changing
  20250.                     the class of the structure.
  20251.  
  20252.                     To change the class of a structure, you must replace
  20253.                     the first "Class/Word" pair of the structure with a
  20254.                     Null "Word" and a class indicating the new class name.
  20255.  
  20256.                                          Text
  20257.  
  20258.                     When a word is replaced in a text line, the Str:Len of
  20259.                     the line is changed by the difference in lengths
  20260.                     between the old and new values.
  20261.  
  20262.  
  20263.  
  20264.  
  20265.  
  20266.  
  20267.  
  20268.  
  20269.  
  20270.  
  20271.  
  20272.  
  20273.  
  20274.  
  20275.  
  20276.           Chapter Five - JORF Functions                                 325
  20277.  
  20278.  
  20279.  
  20280.  
  20281.  
  20282.  
  20283.  
  20284.  
  20285.                                        Word:In
  20286.  
  20287.  
  20288.           Function  Word:In ( Structure, Word ) 
  20289.  
  20290.           Purpose   Searches for the existence of Word in a structure or
  20291.                     parsed command line, and returns the position if it is
  20292.                     found.  Returns zero if Class is not found.
  20293.  
  20294.           Returns   Position of Word or zero if not found.
  20295.  
  20296.           See Also  Str:In, Word:At, Class:In.
  20297.  
  20298.           Notes     Both structures and text lines are stored as an array
  20299.                     of Class:Word pairs. You can use this function to
  20300.                     search for the "Word" portion of the pair.  
  20301.  
  20302.                     When searching for a "Word" the value being searched
  20303.                     for need may be a string, number, text pointer or
  20304.                     array.  The number of words can be obtained using
  20305.                     Word:Len.  Word:In can be used to get the value of an
  20306.                     element in a structure without using the structure
  20307.                     pointer operator.
  20308.  
  20309.                                         Arrays
  20310.  
  20311.                     You can use Word:In to find the position of an array
  20312.                     value without regard to position.  
  20313.  
  20314.                                       Structures
  20315.  
  20316.                     You can use Word:in to find the absolute position of a
  20317.                     value in a structure without regard to the structure
  20318.                     element name.  
  20319.  
  20320.  
  20321.  
  20322.  
  20323.  
  20324.  
  20325.  
  20326.  
  20327.  
  20328.  
  20329.  
  20330.  
  20331.  
  20332.  
  20333.  
  20334.  
  20335.  
  20336.  
  20337.           The JORF Manual (Shareware Disk Version)                      326
  20338.  
  20339.  
  20340.  
  20341.  
  20342.  
  20343.  
  20344.  
  20345.  
  20346.                                          Text
  20347.  
  20348.                     There are two ways to search for a word in a line of
  20349.                     text.  One is to use Str:In to find a substring, and
  20350.                     the other is to use Word:In to find a parsed word.  The
  20351.                     words are parsed using space or punctuation character
  20352.                     delimiters.  Expressions quoted with single or double
  20353.                     quotes are considered a single word.
  20354.  
  20355.                          Str:In("Four score and twenty","And")   12
  20356.                          Word:In("Four scord and twenty", "And") 3
  20357.  
  20358.                          Str:In("Josephine's Pen", "Pen")        13
  20359.                          Word:In("Josephine's Pen", "Pen")  4 
  20360.  
  20361.  
  20362.  
  20363.  
  20364.  
  20365.  
  20366.  
  20367.  
  20368.  
  20369.  
  20370.  
  20371.  
  20372.  
  20373.  
  20374.  
  20375.  
  20376.  
  20377.  
  20378.  
  20379.  
  20380.  
  20381.  
  20382.  
  20383.  
  20384.  
  20385.  
  20386.  
  20387.  
  20388.  
  20389.  
  20390.  
  20391.  
  20392.  
  20393.  
  20394.  
  20395.  
  20396.  
  20397.  
  20398.           Chapter Five - JORF Functions                                 327
  20399.  
  20400.  
  20401.  
  20402.  
  20403.  
  20404.  
  20405.  
  20406.  
  20407.                                        Word:Len
  20408.  
  20409.  
  20410.           Function  Word:Len ( Structure ) 
  20411.  
  20412.           Purpose   Returns the number of elements in a structure, or the
  20413.                     number of words in a parsed text line.
  20414.  
  20415.           Returns   Number of words.
  20416.  
  20417.           See Also  Word:At, Str:Len.
  20418.  
  20419.           Notes     Returns the number of words in a line of text, and the
  20420.                     number of elements in a structure or array.  This
  20421.                     function is commonly used with Word:At to examine text,
  20422.                     and structure on an element by element basis.
  20423.  
  20424.                                         Arrays
  20425.  
  20426.                     Returns exactly the same value as Arr:Len().  This
  20427.                     function is a little more general, and is the preferred
  20428.                     function if you are counting expressions in a variable
  20429.                     that may or may not be an array.  Setting an array
  20430.                     element to null is the same as "using" it, so if you
  20431.                     set A[2000]=null, then the array length will be 2000.
  20432.  
  20433.                                       Structures
  20434.  
  20435.                     The length of a structure includes a structure header
  20436.                     element that contains the class name and a pointer to
  20437.                     the class definition.  So a structure with three
  20438.                     elements has a Word:Len of four. 
  20439.  
  20440.                     Structures do not have the same number of elements as
  20441.                     the class definition.  Even if there are 20 elements in
  20442.                     a class definition, a structure will only store those
  20443.                     elements that have a value.  Elements that have not
  20444.                     been set are reported as Null, but in fact they are not
  20445.                     stored at all.  Elements are not moved when set to
  20446.                     null, except when the file is rebuilt.  So setting a
  20447.                     structure element to null will not shrink an array, but
  20448.                     the array will shrink if stored in a file that is then
  20449.                     rebuilt.
  20450.  
  20451.                                          Text
  20452.  
  20453.                     The origin of this function lies in the origin of JORF
  20454.                     as a Japanese/English language translator.  When I was
  20455.                     trying to build one in late 1987 I got so frustrated by
  20456.                     the memory and file management problems of the C
  20457.                     language that I decided to create a new language to do
  20458.  
  20459.           The JORF Manual (Shareware Disk Version)                      328
  20460.  
  20461.  
  20462.  
  20463.  
  20464.  
  20465.  
  20466.  
  20467.                     my parsing and dictionary management.  My new language
  20468.                     became the core of the JORF language.
  20469.  
  20470.                     In it's parser role, the Word:Len() function considers
  20471.                     each word separate, as well as each punctuation
  20472.                     character.  Single and double quotes are handled
  20473.                     specially.  Quoted expressions are considered a single
  20474.                     word.  The following lines are shown with their
  20475.                     lengths:
  20476.  
  20477.                          Line                     Word:Len
  20478.  
  20479.                          This is a line of text             6
  20480.                          A line with  (Parentheses)              6
  20481.                          "A Quote"                1
  20482.                          Another 'Quote with a period'.          3
  20483.                          !@#$%^&*()                    10
  20484.                          "!@#$%^&*()"                  1
  20485.                          '"'                      1
  20486.  
  20487.  
  20488.  
  20489.  
  20490.  
  20491.  
  20492.  
  20493.  
  20494.  
  20495.  
  20496.  
  20497.  
  20498.  
  20499.  
  20500.  
  20501.  
  20502.  
  20503.  
  20504.  
  20505.  
  20506.  
  20507.  
  20508.  
  20509.  
  20510.  
  20511.  
  20512.  
  20513.  
  20514.  
  20515.  
  20516.  
  20517.  
  20518.  
  20519.  
  20520.           Chapter Five - JORF Functions                                 329
  20521.  
  20522.  
  20523.  
  20524.  
  20525.  
  20526.  
  20527.  
  20528.  
  20529.  
  20530.  
  20531.  
  20532.  
  20533.                                       Appendix A
  20534.                                JORF Language Reference
  20535.  
  20536.  
  20537.  
  20538.  
  20539.                                      Basic Rules
  20540.  
  20541.                     Indentation controls program flow.
  20542.                     Commands and variable names are not case sensitive.
  20543.                     The end of line is the end of the line.
  20544.                     The comment character is a pipe symbol (|).
  20545.                     Parameter lists are surrounded by Parentheses
  20546.  
  20547.                                       Key Words
  20548.  
  20549.                     Class          Used to declare a new class.
  20550.                     Parent         In a class definition, designates a
  20551.                                    parent class.
  20552.                     Jorf           The default class for all objects.
  20553.                     Index          Declares an index field within a class
  20554.                     Poly           Indicates a polymorphic method call
  20555.  
  20556.                          Math Symbols and Order of Operations
  20557.  
  20558.                     ->                  Structure Element Pointer
  20559.                     []                  Array reference
  20560.                     - ++ --             Negation, Increment, Decrement
  20561.                     * / %               Multiplication, Division, Modulus
  20562.                     + -                 Addition and Subtraction
  20563.                     = <> !=             Equality and Inequality
  20564.                     > < >= <=           Comparison
  20565.                     && ?? And Or        Logical And, Or
  20566.                     =                   Assignment of value
  20567.  
  20568.  
  20569.  
  20570.  
  20571.  
  20572.  
  20573.  
  20574.  
  20575.  
  20576.  
  20577.  
  20578.  
  20579.  
  20580.  
  20581.           The JORF Manual (Shareware Disk Version)                      330
  20582.  
  20583.  
  20584.  
  20585.  
  20586.  
  20587.  
  20588.  
  20589.  
  20590.  
  20591.  
  20592.  
  20593.  
  20594.                                       Appendix B
  20595.                                   Library Functions
  20596.  
  20597.  
  20598.  
  20599.  
  20600.      Function                            Description                     Returns
  20601.  
  20602.      Arr:Del (Arr,Pos,Cnt)               Delete Cnt Elements at Pos        Array
  20603.      Arr:Dir (WildCard,Excl,Wid)         Directory minus exclusions        Array
  20604.      Arr:Ins (Arr,Pos,Cnt)               Insert Cnt Elements at Pos        Array
  20605.      Arr:Len (Arr)                       Number of Elements                Count
  20606.      Arr:Pick (Arr,Cmd,T,R,C,L,Df)       Show a Pick Menu                   Pick
  20607.      Arr:Printers                        Returns Printer List              Array
  20608.      Arr:Sort (Arr,Cmd,Dir)              Sort Ascending/Descending         Array
  20609.  
  20610.      Char:Del (Count)                    Del Spaces                         None
  20611.      Char:Get                            Get ASCII value                   Value
  20612.      Char:Ins (Count)                    Ins Spaces                         None
  20613.      Char:Put (Value)                    ASCII value to Screen              None
  20614.      Char:Print (Printer, Value)         ASCII value to Printer             None
  20615.  
  20616.      Class:At (Struct,Pos)               Class at Position                 Class
  20617.      Class:AtPut (Struct,Pos,Class)      Change Class                     If put
  20618.      Class:In (Struct,Class)             Get Position                   Position
  20619.      Class:Read (Name)                   Read Class                      If Read
  20620.      Class:Write                         Write current Class          If Written
  20621.  
  20622.      Date:Add (Date,Days,Mths,Yrs)       Add Days, Months, Years to dateNew Date
  20623.      Date:Get                            Get today's date           Today's date
  20624.      Date:Set (Date)                     Set system clock              Ok if set
  20625.      Date:SetFmt (FormatStructure)       Set default format, Month names    None
  20626.      Date:Str (Date, Format)             Convert date to string date Date string
  20627.      Date:Sub (Date,Days,Mths,Yrs)       Subtract Days, Months, Years from date
  20628.                                                                         New Date
  20629.  
  20630.      Db:Append (Name,Line)               Append record to file             If Ok
  20631.      Db:Close (Name)                     Close a dBASE file                If Ok
  20632.      Db:Create (Name)                    Create a dBASE file               If Ok
  20633.      Db:Delete (Name,Recno)              Delete a Record           Ok if deleted
  20634.      Db:Go (Name,Recno)                  Go Top, Bottom or Recno     Recno if Ok
  20635.      Db:Info (Name,InfoFlag)             Get file size,found,deleted Info result
  20636.      Db:Lock (Name,Recno)                Lock and read Record   Record if Locked
  20637.      Db:Map (Nm,Lev,Class,Map)           Map dBASE File                     None
  20638.      Db:Ntxord (Name,Ntxnumber)          Set index to use      Ok if valid index
  20639.      Db:Pack (Name,Showit)               Rebuild dBASE file, NTXs          If Ok
  20640.  
  20641.  
  20642.  
  20643.           Appendix                                                      331
  20644.  
  20645.  
  20646.  
  20647.  
  20648.  
  20649.  
  20650.  
  20651.      Function                            Description                     Returns
  20652.  
  20653.      Db:Read (Name,Recno)                Read Line/Record                 Record
  20654.      Db:Recall (Name,Recno)              Undelete a Record     Ok if was deleted
  20655.      Db:Seek (Name,Indexval)             Seek for an index key    Recno if found
  20656.      Db:Set (Name,Flag,Value)            Set dBASE settings        Old set value
  20657.      Db:Skip (Name,Recno,Skipby)         Get next/Prev record number 
  20658.                                                                 Recno if not Eof
  20659.      Db:Unlock (Name,Record)             Unlocked a locked record 
  20660.                                                             If Ok and was locked
  20661.      Db:Write (Name,Record)              Write dBASE Record                 None
  20662.  
  20663.      Event:Add (Class,Type,Lev)          Add Event Class                    None
  20664.      Event:Del (Type)                    Delete Event Class                 None
  20665.      Event:Do (Method,Type)              Do Event Method                  Return
  20666.  
  20667.      False                               Logical False                      Null
  20668.  
  20669.      File:Append (Name,Line)             Append line or record to file     If Ok
  20670.      File:Backup (Name)                  Create a Backup                   If Ok
  20671.      File:Chgdir (Path)                  Change Directory                  If Ok
  20672.      File:Close (Name)                   Close a file                      If Ok
  20673.      File:Copy (From,To)                 Copy File                         If Ok
  20674.      File:Create (Name)                  Create a mapped or dBASE file     If Ok
  20675.      File:Del (Name)                     Delete File                       If Ok
  20676.      File:Exist (Name,Access)            Check Existence/Access            If Ok
  20677.      File:Len (Name)                     Get Size of File              Size in K
  20678.      File:Load (Name)                    Load Text File                     Text
  20679.      File:Lock (Name)                    Lock a file for exclusive use If Locked
  20680.      File:Map (Nm,Lev,Class,Type,Map)    Map ASCII or dBASE File            None
  20681.      File:MoveTo (Name,Pos)              Move to Beg/Ene                   If Ok
  20682.      File:Ok (Name)                      Not EOF in File:Read              If Ok
  20683.      File:Print (Name,Device,Flags)      Print file to print device        If Ok
  20684.      File:Read (Name,Size,Off)           Read Line/Record            Line/Record
  20685.      File:Rename (From,To)               Rename File                       If Ok
  20686.      File:Save (Name,Text)               Save Text to File                 If Ok
  20687.      File:Unlock (Name)                  Unlocked a locked file 
  20688.                                                             If Ok and was locked
  20689.      File:Write (Name,Line,Size,Off)     Write Line/Record                  None
  20690.  
  20691.      For/Thru/Step                       Incrementing Loop                  None
  20692.  
  20693.      Here                                Return level                      Level
  20694.  
  20695.      If/Else                             Conditional Branch                 None
  20696.  
  20697.      Jorf:Cls                            Clear DOS Screen                   None
  20698.      Jorf:Del (Variable)                 Delete Text                        None
  20699.      Jorf:Do (MethodName)                Interpret a string               Return
  20700.      Jorf:Dup (Text)                     Copy Text or Struct              A Copy
  20701.      Jorf:Exit (Status,Msg,Cmd)          Exit                            Doesn't
  20702.      Jorf:File (Name Level)              Current Project                    None
  20703.      Jorf:Flush (Minimum)                Flush memory                       None
  20704.      Jorf:Info (InfoFlag)                Get disk space, Memory, Etc. Info value
  20705.  
  20706.  
  20707.           The JORF Manual (Shareware Disk Version)                      332
  20708.  
  20709.  
  20710.  
  20711.  
  20712.  
  20713.  
  20714.  
  20715.      Function                            Description                     Returns
  20716.  
  20717.      Jorf:Ini                            Reread .INI file                   None
  20718.      Jorf:Move (Srce,Dest,Class)         Move Buffer                      A Copy
  20719.      Jorf:Pack                           Pack JORF File                     None
  20720.      Jorf:Printer                        Display printer selection menu 
  20721.                                                                  Device selected
  20722.      Jorf:Rebuild                        Rebuild JORF File                  None
  20723.      Jorf:Sound (Freq,Dur)               Make a Sound                       None
  20724.      Jorf:System (Cmd,Flgs,Msg)          DOS shell                        Return
  20725.      Jorf:Write (Variable)               Write var to current project If written
  20726.  
  20727.      Kbd:Bye                             Flush Keyboard Stream              None
  20728.      Kbd:Get (CursorSize)                Keyboard Input                      Key
  20729.      Kbd:Got                             Last Key Value                      Key
  20730.      Kbd:Hit                             Key Waiting?                 True/False
  20731.      Kbd:Put (Keys)                      Stuff Keystrokes                   None
  20732.  
  20733.      Key:Add (RuleStructure)             Add String Key                     None
  20734.      Key:Del (RuleStructure)             Delete String Key            Sets Found
  20735.      Key:Find (RuleStructure)            Find String Key              Sets Found
  20736.      Key:Next (RuleStructure)            Find Next                    Sets Found
  20737.      Key:Prev (RuleStructure)            Find Prev                    Sets Found
  20738.  
  20739.      Line:Del (Count)                    Delete Lines                       None
  20740.      Line:Inp (Fld,R,C,L,W)              Input Field/Text             Field/Text
  20741.      Line:Ins (Count)                    Insert Lines                       None
  20742.      Line:Out (Fld,R,C,L,W)              Output Field/Text                  None
  20743.      Line:Rel                            Release current input              None
  20744.  
  20745.      Mem:Ptr                             A Global Pointer                   None
  20746.  
  20747.      Move:To (Row,Column)                Move Cursor                        None
  20748.      Move:By (Row,Column)                Move Cursor                        None
  20749.  
  20750.      Msg:Add (Title,Type,Text)           A Dialog Box                 True/False
  20751.  
  20752.      New (Class:Var1,Class:Var2)         Create Variables                   None
  20753.  
  20754.      Null                                Nothing                            Null
  20755.  
  20756.      Num:Abs (Num)                       Absolute value                   Number
  20757.      Num:Btw (A,B,C)                     A, Between B and C               Number
  20758.      Num:Exp (Num)                       Exponent e to the Num            Number
  20759.      Num:Log (Num)                       Log of Num                       Number
  20760.      Num:Max (A,B)                       Higher of A or B                 Number
  20761.      Num:Min (A,B)                       Lower of A or B                  Number
  20762.      Num:Pow (Num,Pow)                   Num to the Power                 Number
  20763.      Num:Rand (High,Low)                 Random Number                    Number
  20764.      Num:Sqrt (Num)                      Random Number                    Number
  20765.  
  20766.      Ok                                  Ok                                    1
  20767.  
  20768.  
  20769.           Appendix                                                      333
  20770.  
  20771.  
  20772.  
  20773.  
  20774.  
  20775.  
  20776.  
  20777.      Function                            Description                     Returns
  20778.  
  20779.      Rep:Add (Title,R,C,L,W,Lev,Fmt)     Create report file                 None
  20780.  
  20781.      Return (Value)                      Return a value                     None
  20782.  
  20783.      Rule:Add (RuleStructure)            Add Rule                           None
  20784.      Rule:Del (RuleStructure)            Delete Rule                  Sets Found
  20785.      Rule:Find (RuleStructure)           Find Rule                    Sets Found
  20786.      Rule:Next (RuleStructure)           Find Next Rule               Sets Found
  20787.      Rule:Prev (RuleStructure)           Find Previous Rule           Sets Found
  20788.  
  20789.      Str:Aft (String,Chars)              String after chars            Substring
  20790.      Str:At (String,Pos,Len)             Get Substring                 Substring
  20791.      Str:AtChar (String,Chars)           String up to chars            Substring
  20792.      Str:AtCut (String,Pos)              Truncate String                  String
  20793.      Str:AtDel (String,Pos,Cnt)          Delete Characters                String
  20794.      Str:AtPut (String,Pos,Ins)          Insert Characters                String
  20795.      Str:AtSet (String,Pos,Ins,Cnt)      Insert Rep Chars                 String
  20796.      Str:In (String,Substring)           Get Substring                  Position
  20797.      Str:Ind (String)                    Num of lead Spaces                Count
  20798.      Str:Len (String)                    Number of Chars                  Length
  20799.      Str:NPad (String,Length)            Null pad string to Length Padded string
  20800.      Str:Pad (String,Length)             Space pad string to LengthPadded string
  20801.      Str:Print (Prn,String)              String to Printer                  None
  20802.      Str:Put (String)                    Display Text                       None
  20803.      Str:PutLine (Line)                  Display Text, NL                   None
  20804.      Str:RPad (String,Length)            Space pad string Right Justified
  20805.                                                                    Padded string
  20806.  
  20807.      Struct:Find (Class,Index,Value)     Find record w/ auto index        Record
  20808.      Struct:Find (Class,Index,Value)     Find record w/ auto index        Record
  20809.      Struct:Find (Class,Index,Value)     Find record w/ auto index        Record
  20810.  
  20811.      Switch/Case/Else                    Conditional Branch                 None
  20812.  
  20813.      Text:Add (Line,Text)                Create text block              New Text
  20814.      Text:At (Text,Pos)                  Text Line at Pos                   Line
  20815.      Text:Bot (Text)                     Last Line of Text             Last Line
  20816.      Text:Chg (Text,Line)                Change line of text                Text
  20817.      Text:Len (Text)                     Number of lines              Line Count
  20818.      Text:Next (Text)                    Next line of Text             Next Line
  20819.      Text:Pos (Text)                     Line num of Text                 Number
  20820.      Text:Prev (Text)                    Prev line of Text             Prev Line
  20821.      Text:Ptr (Text)                     Ptr to indented Text               Text
  20822.      Text:Top (Text)                     First Line of Text           First Line
  20823.      Text:Wid (Text)                     Width of widest Line              Width
  20824.  
  20825.      Time:Add (Time,Mins,Hrs,Secs)       Add Minutes, hours, seconds   New  time
  20826.      Time:Get                            Get current time                    Now
  20827.      Time:Set (Time)                     Set system clock              Ok if set
  20828.      Time:SetFmt (FormatStructure)       Set default format, AM/PM name     None
  20829.  
  20830.  
  20831.           The JORF Manual (Shareware Disk Version)                      334
  20832.  
  20833.  
  20834.  
  20835.  
  20836.  
  20837.  
  20838.  
  20839.      Function                            Description                     Returns
  20840.  
  20841.      Time:Str (Time, Format)             Convert time  to string time 
  20842.                                                                      Time string
  20843.      Time:Sub (Time,Mins,Hrs,Secs)       Subtract Minutes, hours seconds 
  20844.                                                                         New time
  20845.      Time:Ticks                          Get Ticks                         Ticks
  20846.  
  20847.      To:ASCII (String)                   Get ASCII Value                   Value
  20848.      To:Caps (String)                    Cvt to Capitals                  String
  20849.      To:Char (Number)                    Cvt to Letter                    String
  20850.      To:Date (String)                    Cvt to Date                        Date
  20851.      To:Int (Number)                     Cvt to Integer                  Integer
  20852.      To:Lcs (String)                     Cvt to Lower Case                String
  20853.      To:Num (String,Base)                Cvt to Number                    Number
  20854.      To:Str (Number,Fmt,Base,Wid)        Cvt to String                    String
  20855.      To:Time (String)                    Cvt to Time                        Time
  20856.      To:Ucs (String)                     Cvt to Upper Case                String
  20857.  
  20858.      True                                Logical True                          1
  20859.  
  20860.      While/Break/Continue                A Loop                             None
  20861.  
  20862.      Win:Add (Title,R,C,L,W,Lv,Txt)      Add new Window                     None
  20863.      Win:Add (WindowStruct)              Add new Window                     None
  20864.      Win:Attr (Attribute)                Change Attribute                   None
  20865.      Win:Block (Cmd,Fnc)                 Do Block Function                  Null
  20866.      Win:Chg (Marker,R,C,L,W,Txt)        Change button area in Window       None
  20867.      Win:Del                             Delete Window                      None
  20868.      Win:Dsp                             Redisplay all Windows              None
  20869.      Win:FLRCO (Mode)                    Change Wrap Mode              Prev Mode
  20870.      Win:Magic (Mode)                    Change Interpret Mode         Last Mode
  20871.      Win:Msg (Message)                   Set Message                        None
  20872.      Win:Pause (Hundredths)              Pause                               Key
  20873.      Win:Ptr                             Get WindowStruct              Structure
  20874.      Win:Repl (From,To,Flags)            Replace Strings                    None
  20875.      Win:Search (Word,Flags)             Replace Strings                    None
  20876.      Word:At (Struct,Pos)                Word at Pos                        Word
  20877.      Word:AtDel (Struct,Pos,Cnt)         Squeeze Structure                  None
  20878.      Word:AtIns (Struct,Pos,Cnt)         Expand Structure                   None
  20879.      Word:AtPut (Struct,Pos,Word)        Change Word at Pos                 None
  20880.      Word:In (Struct,Word)               Get Position of Word           Position
  20881.      Word:Len (Struct)                   Number of Words                   Count
  20882.  
  20883.  
  20884.  
  20885.  
  20886.  
  20887.  
  20888.  
  20889.  
  20890.  
  20891.  
  20892.  
  20893.  
  20894.           Appendix                                                      335
  20895.  
  20896.  
  20897.  
  20898.  
  20899.  
  20900.  
  20901.  
  20902.  
  20903.  
  20904.  
  20905.  
  20906.  
  20907.                                       Appendix C
  20908.                                    Keyboard Values
  20909.  
  20910.  
  20911.  
  20912.  
  20913.      Char       Normal     Shift        Ctrl            Alt
  20914.  
  20915.      a          a_Key      A_Key        Ctrl_A_Key      Alt_A_Key
  20916.      b          b_Key      B_Key        Ctrl_B_Key      Alt_B_Key
  20917.      c          c_Key      C_Key        Ctrl_C_Key      Alt_C_Key
  20918.      d          d_Key      D_Key        Ctrl_D_Key      Alt_D_Key
  20919.      e          e_Key      E_Key        Ctrl_E_Key      Alt_E_Key
  20920.      f          f_Key      F_Key        Ctrl_F_Key      Alt_F_Key
  20921.      g          g_Key      G_Key        Ctrl_G_Key      Alt_G_Key
  20922.      h          h_Key      H_Key        BackSpace_Key   Alt_H_Key
  20923.      i          i_Key      I_Key        Tab_Key         Alt_I_Key
  20924.      j          j_Key      J_Key        Ctrl_Return_Key Alt_J_Key
  20925.      k          k_Key      K_Key        Ctrl_K_Key      Alt_K_Key
  20926.      l          l_Key      L_Key        Ctrl_L_Key      Alt_L_Key
  20927.      m          m_Key      M_Key        Return_Key      Alt_M_Key
  20928.      n          n_Key      N_Key        Ctrl_N_Key      Alt_N_Key
  20929.      o          o_Key      O_Key        Ctrl_O_Key      Alt_O_Key
  20930.      p          p_Key      P_Key        Ctrl_P_Key      Alt_P_Key
  20931.      q          q_Key      Q_Key        Ctrl_Q_Key      Alt_Q_Key
  20932.      r          r_Key      R_Key        Ctrl_R_Key      Alt_R_Key
  20933.      s          s_Key      S_Key        Ctrl_S_Key      Alt_S_Key
  20934.      t          t_Key      T_Key        Ctrl_T_Key      Alt_T_Key
  20935.      u          u_Key      U_Key        Ctrl_U_Key      Alt_U_Key
  20936.      v          v_Key      V_Key        Ctrl_V_Key      Alt_V_Key
  20937.      w          w_Key      W_Key        Ctrl_W_Key      Alt_W_Key
  20938.      x          x_Key      X_Key        Ctrl_X_Key      Alt_X_Key
  20939.      y          y_Key      Y_Key        Ctrl_Y_Key      Alt_Y_Key
  20940.      z          z_Key      Z_Key        Ctrl_Z_Key      Alt_Z_Key
  20941.  
  20942.      0          0_Key                                   Alt_0_Key
  20943.      1          1_Key                                   Alt_1_Key
  20944.      2          2_Key                                   Alt_2_Key
  20945.      3          3_Key                                   Alt_3_Key
  20946.      4          4_Key                                   Alt_4_Key
  20947.      5          5_Key                                   Alt_5_Key
  20948.      6          6_Key                                   Alt_6_Key
  20949.      7          7_Key                                   Alt_7_Key
  20950.      8          8_Key                                   Alt_8_Key
  20951.      9          9_Key                                   Alt_9_Key
  20952.  
  20953.  
  20954.  
  20955.           The JORF Manual (Shareware Disk Version)                      336
  20956.  
  20957.  
  20958.  
  20959.  
  20960.  
  20961.  
  20962.  
  20963.      Char       Normal     Shift        Ctrl            Alt
  20964.  
  20965.      F1         F1_Key     Shift-F1_Key Ctrl_F1_Key     Alt_F1_Key
  20966.      F2         F2_Key     Shift-F2_Key Ctrl_F2_Key     Alt_F2_Key
  20967.      F3         F3_Key     Shift-F3_Key Ctrl_F3_Key     Alt_F3_Key
  20968.      F4         F4_Key     Shift-F4_Key Ctrl_F4_Key     Alt_F4_Key
  20969.      F5         F5_Key     Shift-F5_Key Ctrl_F5_Key     Alt_F5_Key
  20970.      F6         F6_Key     Shift-F6_Key Ctrl_F6_Key     Alt_F6_Key
  20971.      F7         F7_Key     Shift-F7_Key Ctrl_F7_Key     Alt_F7_Key
  20972.      F8         F8_Key     Shift-F8_Key Ctrl_F8_Key     Alt_F8_Key
  20973.      F9         F9_Key     Shift-F9_Key Ctrl_F9_Key     Alt_F9_Key
  20974.      F10        F10_Key    Shift-F10_Key                Ctrl_F10_KeyAlt_F10_Key
  20975.      F11        F11_Key    Shift-F11_Key                Ctrl_F11_KeyAlt_F11_Key
  20976.      F12        F12_Key    Shift-F12_Key                Ctrl_F12_KeyAlt_F12_Key
  20977.  
  20978.      Space      Space_Bar
  20979.      !          !_Key
  20980.      "          "_Key
  20981.      #          #_Key
  20982.      $          $_Key
  20983.      %          %_Key
  20984.      &          &_Key
  20985.      '          '_Key
  20986.      (          (_Key
  20987.      )          )_Key
  20988.      *          *_Key
  20989.      +          +_Key                                   Alt_+_Key
  20990.      ,(comma)   ,_Key
  20991.      -(minus)   -_Key                                   Alt_-_Key
  20992.      .(period) ._Key
  20993.      /          /_Key
  20994.      :(colon)   :_Key
  20995.      ;(semi-colon)   ;_Key
  20996.      <          <_Key
  20997.      =          =_Key
  20998.      >          >_Key
  20999.      ?          ?_Key
  21000.      @          @_Key                                   Alt_@_Key
  21001.      [          [_Key                   Escape_Key
  21002.      \          \_Key                   Ctrl_\_Key
  21003.      ]          ]_Key                   Ctrl_]_Key
  21004.      ^ (carat) ^_Key                    Ctrl_^_Key
  21005.      _          __Key                   Ctrl___Key
  21006.      `          `_Key
  21007.      {          {_Key
  21008.      | (pipe)   |_Key
  21009.      }          }_Key
  21010.      ~ (tilde) ~_Key
  21011.  
  21012.  
  21013.  
  21014.  
  21015.  
  21016.           Appendix                                                      337
  21017.  
  21018.  
  21019.  
  21020.  
  21021.  
  21022.  
  21023.  
  21024.      Char       Normal     Shift        Ctrl            Alt
  21025.  
  21026.      Rubout     BackSpace_Key           Ctrl_BackSpace_Key
  21027.      Enter      Enter_Key               Ctrl_Enter_Key
  21028.      Tab        Tab_Key
  21029.      Escape     Esc_Key
  21030.      Back Tab   Back_Tab_Key
  21031.      Up Arrow   Up_Arrow_Key
  21032.      Down Arrow            Down_Arrow_Key
  21033.      Right Arrow           Right_Arrow_Key         Ctrl_Right_Arrow_Key
  21034.                                         Alt_Right_Arrow_Key
  21035.      Left Arrow            Left_Arrow_Key          Ctrl_Left_Arrow_Key
  21036.                                         Alt_Left_Arrow_Key
  21037.      Home       Home_Key                Ctrl_Home_Key   Alt_Home_Key
  21038.      Page Up    Page_Up_Key                             Ctrl_Page_Up_Key
  21039.                                                         Alt_Page_Up_Key
  21040.      Page Down  Page_Down_Key           Ctrl_Page_Down_Key  Alt_Page_Down_Key
  21041.      End        End_Key                 Ctrl_End_Key    Alt_End_Key
  21042.  
  21043.      Delete     Del_Key                                 Alt_Ins_Key
  21044.      Insert     Ins_Key                                 Alt_Del_Key
  21045.  
  21046.  
  21047.  
  21048.  
  21049.  
  21050.  
  21051.  
  21052.  
  21053.  
  21054.  
  21055.  
  21056.  
  21057.  
  21058.  
  21059.  
  21060.  
  21061.  
  21062.  
  21063.  
  21064.  
  21065.  
  21066.  
  21067.  
  21068.  
  21069.  
  21070.  
  21071.  
  21072.  
  21073.  
  21074.  
  21075.  
  21076.  
  21077.           The JORF Manual (Shareware Disk Version)                      338
  21078.  
  21079.  
  21080.  
  21081.  
  21082.  
  21083.  
  21084.  
  21085.  
  21086.  
  21087.  
  21088.  
  21089.  
  21090.                                       Appendix D
  21091.                                   The JORF.INI File
  21092.  
  21093.  
  21094.  
  21095.  
  21096.  
  21097.      The JORF interpreter uses a Windows style INI file to set initialization
  21098.      values.  For the DOS version, the file name is JORF.INI.  The windows
  21099.      version uses a file called JORFWIN.INI.  Compiled JORF applications have
  21100.      use a file with the same name as the program, with the extension "INI".  
  21101.  
  21102.      Thee new version of EDITINI.J allows you to set many of these features. 
  21103.      This appendix exists as a reference to each setting.
  21104.  
  21105.      There are three major sections of the ini file.  The first section controls
  21106.      operating options and video handling.  The second section controls
  21107.      printers, and the final section controls screen colors.  
  21108.  
  21109.                                 INI Operating Options
  21110.  
  21111.      These options control how the JORF interpreter operates.  Only the first
  21112.      four letters of the command are used.  You will notice that most options
  21113.      only affect DOS systems, and not Windows systems.
  21114.  
  21115.           BIOS=No             DOS Only  Use Bios Screens
  21116.           Mouse=Yes           DOS Only  Use Mouse if available
  21117.           Scroll=Yes               DOS Only  If No - doesn't use scroll
  21118.           Explode=3           DOS Only  Speed of display
  21119.           Mono=No             DOS Only  Use Mono colors 
  21120.           Multiuser=No                  Yes for Network Access
  21121.           Mem Stats=No                  Memory Details
  21122.           Ram Disk=E:\                  Use Ram Disk
  21123.  
  21124.      BIOS=No   DOS Only.   Using BIOS video display is the official way to
  21125.                handle video functions on IBM PC computers.  Many of the BIOS
  21126.                routines are very slow, however, so JORF usually uses direct
  21127.                video access.  Some computers, notably EGA systems, have enough
  21128.                differences that the video display is really whacked out.  If
  21129.                this happens, try setting BIOS=Yes  to see if the video starts
  21130.                working properly.
  21131.  
  21132.      Mouse=Yes DOS Only.  The JORF interpreter will know if you have a mouse
  21133.                active.  Some mice may have problems, so this is a way to turn
  21134.                off the mouse in JORF so you can still have a mouse driver
  21135.                loaded.  
  21136.  
  21137.  
  21138.           Appendix                                                      339
  21139.  
  21140.  
  21141.  
  21142.  
  21143.  
  21144.  
  21145.  
  21146.      Scroll=Yes     DOS Only.  I recently had a case where I suspected a
  21147.                     specific VGA card did not handle the BIOS scroll function
  21148.                     properly.  Although the use of this function speeds
  21149.                     scrolling, it is not required so I created an option in case
  21150.                     you also suspect a problem with scrolling.  You should note
  21151.                     that JORF uses the scroll function primarily to clear the
  21152.                     inside of windows.
  21153.  
  21154.      Explode=3 DOS Only.  Exploding windows are a cute feature found in the DOS
  21155.                version of JORF.  An exploding speed of 3 seems about right for
  21156.                the right video affect.  Some people dislike this, and should set
  21157.                this to be Explode=0  to have windows display without exploding.
  21158.  
  21159.      Mono=No   DOS Only.  Monochrome video override.  Normally JORF knows
  21160.                whether you have a monochrome or color monitor.  Some people have
  21161.                portables with monochrome monitors that display shades of gray.  
  21162.                On  these monitors the appearance of JORF may be enhanced if you
  21163.                set Mono=Yes to force the system into monochrome mode.
  21164.  
  21165.      Multiuser=No   DOS and Windows.  This one is really important.  If you want
  21166.                     to have multiple access  to  a file, you must set
  21167.                     Multiuser=Yes.    This includes access on DOS systems when
  21168.                     you are using a program switcher like Software Carousel, 
  21169.                     and also multiple access using Microsoft Windows.
  21170.  
  21171.                As soon as you switch Multiuser=Yes you must also take other
  21172.                action.   First, you must load SHARE.EXE so that JORF can
  21173.                properly lock the files.  You will get a nice message if you do
  21174.                not have share loaded.
  21175.  
  21176.                You should also have a disk cache program like SMARTDRV running,
  21177.                because JORF does a lot more file IO in multiuser mode (It must
  21178.                rewrite the file header after every file activity)   Even with a
  21179.                cache program running, JORF is just not as fast in multiuser mode
  21180.                as it is in single user mode. 
  21181.  
  21182.      Decimal=. DOS and Windows.  Some countries use the comma to mark the
  21183.                decimal point, and the period to mark thousands.  If you wish to
  21184.                use this notation, change the Decimal entry to "Decimal = ,".  
  21185.  
  21186.                          Decimal = .         1,234,567.89
  21187.                          Decimal = ,         1.234.567,89
  21188.  
  21189.  
  21190.                When you change decimal indicator to a comma, all numbers that
  21191.                the operator enters must be in comma decimal format.  However,
  21192.                all numbers and number formatters in the program code must be in
  21193.                American (period decimal) format.  This includes the characters
  21194.                in a the number formatter used by Num:Str.
  21195.  
  21196.                When you change the decimal indicator to a comma, all numeric
  21197.                values that were written to file as numbers will be changed. 
  21198.  
  21199.           The JORF Manual (Shareware Disk Version)                      340
  21200.  
  21201.  
  21202.  
  21203.  
  21204.  
  21205.  
  21206.  
  21207.                However, numeric values that were written to the file as strings
  21208.                while the decimal indicator was a period must be translated.  To
  21209.                translate a number stored as a string from period decimal to
  21210.                comma decimal, use the To:Num function.
  21211.  
  21212.                Programmers who wish to keep their programs internationalized
  21213.                will take care to avoid storing numbers as strings.  JORF
  21214.                normally stores numbers as numbers, so you don't really have to
  21215.                worry, just don't try to override the default numeric format.
  21216.  
  21217.      Mem Stats=No   DOS and Windows.  This option turns on memory statistics
  21218.                     reporting that I use to help me debug the memory swapping
  21219.                     system.  When you turn this mode on, your program will run
  21220.                     very slowly.  Every memory allocation and deallocation will
  21221.                     be registered, so when the program ends it can report any
  21222.                     un-deallocated buffers.  You will note that usually the
  21223.                     ending is silent, which means that I am successful in my
  21224.                     goal of deallocating every single buffer that I allocate. 
  21225.                     This mode also makes flushing more  apparent, and displays
  21226.                     the currently open file.  
  21227.  
  21228.      Ram Disk=D:\   DOS and Windows.  Since JORF uses a swap file, you can
  21229.                     optionally place this file on a RAM disk.  The RAM disk
  21230.                     should be more than 100K in size, and is best at 512K or
  21231.                     larger.   There is no control if the Ram disk becomes full
  21232.                     and the errors will probably be really ugly. The largest
  21233.                     items in the swap file are screen backgrounds, but also
  21234.                     misspelled text, the program stack, and other space bits may
  21235.                     appear here.  On multiuser systems, you may also use this to
  21236.                     point to a local drive for the swap file.
  21237.  
  21238.  
  21239.                                   INI Printer Set Up
  21240.  
  21241.      When distributed JORF programs come with my printers.  You can easily
  21242.      change them to be your own by modifying the printer set up.  Printer
  21243.      definitions are simple:  The entire line is displayed on a printer
  21244.      selection menu, and the last word is the printer designation.  
  21245.  
  21246.           Printer = Screen,    SCREEN
  21247.           Printer = File,      FILE
  21248.           Printer = HP Laser,  COM1:
  21249.           Printer = Panasonic, LPT1:
  21250.  
  21251.      The options for SCREEN and for FILE invoke special features in the
  21252.      File:Print function to display the file on screen, or rename it to a
  21253.      special file name.  
  21254.  
  21255.      To print to a printer, you the last word of the command must be PRN, AUX,
  21256.      LPT1, LPT2, COM1, or COM2 to indicate default printer, auxiliary, line
  21257.      printer one and two and serial printer one and two respectively.  
  21258.  
  21259.  
  21260.           Appendix                                                      341
  21261.  
  21262.  
  21263.  
  21264.  
  21265.  
  21266.  
  21267.  
  21268.      Under DOS, the different printing mechanisms are distinct.  The easiest and
  21269.      most robust is to print to PRN, the default printer.  To test to see if
  21270.      your printer is working, use the DOS PRINT command to print a small file.  
  21271.      The next most robust is LPT1 and LPT2.  These use a different BIOS call
  21272.      than PRN so they may not work even when PRN works just fine.  These
  21273.      commands send output to parallel printers.  Parallel printers may be
  21274.      identified by having a thick cable and a bigger-than-normal connector on
  21275.      the printer end of the cable.    
  21276.  
  21277.      Under Microsoft Windows, you must reference a printer that you have set up
  21278.      under windows.   JORF automatically searches your windows printers, and
  21279.      will not be able to print to a port without a windows printer set to that
  21280.      port.
  21281.  
  21282.                                   INI Window Colors
  21283.  
  21284.      The final section of the JORF.INI file handles the colors and style of the
  21285.      windows.  This section is more extensive in the DOS version, but also
  21286.      exists in the Windows version.  
  21287.  
  21288.      The colors I supply are specifically related to the mathematical values of
  21289.      a pixel on a color monitor.    Unfortunately these colors, especially
  21290.      background colors, are pretty ugly.   You see what you can do, and compare
  21291.      to other applications that you like to use.
  21292.  
  21293.      Colors are tied to a window background structure that has a name.  The name
  21294.      is set in the first line.  JORF uses some special backgrounds for specific
  21295.      types of windows.  Error boxes use "Error", Message boxes use "Message",
  21296.      and Menu boxes use "Menu".  You can also specify custom backgrounds using a
  21297.      window structure in the Win:Add function.   The default background is
  21298.      "Text".
  21299.  
  21300.      Window=Text                        Background name "Text"
  21301.      +Mono/Color=Mono                   Normally "Mono"
  21302.      +Line Style=double                 Thick,Double,Single,None
  21303.      +Border Color=For/Back   DOS Only  Border Color
  21304.      +Title Color=For/Back    DOS Only  Title Color
  21305.      +Shadow Color=For/Back   DOS Only  Shadow Color
  21306.      +Message Color=For/Back            Message Color
  21307.      +Normal Color=For/Back   DOS Only  Attribute 1
  21308.      +Low Color=For/Back                Attribute 2
  21309.      +Medium Color=For/Back             Attribute 3
  21310.      +High Color=For/Back               Attribute 4
  21311.      +Bold Color=For/Back               Attribute 5
  21312.  
  21313.  
  21314.      Window=Text         DOS and Windows.  Sets the name for this window
  21315.                          background structure.   All options within this
  21316.                          structure start with a plus (+) sign.
  21317.  
  21318.  
  21319.  
  21320.  
  21321.           The JORF Manual (Shareware Disk Version)                      342
  21322.  
  21323.  
  21324.  
  21325.  
  21326.  
  21327.  
  21328.  
  21329.      Mono/Color          If you wish, yo u can set up separate definitions for
  21330.                          monochrome and color monitors even if they have the
  21331.                          same name.  
  21332.  
  21333.      Line Style=         Sets the border line style.  The style can be Single,
  21334.                          Double, Thick, or None. Even if you set None there will
  21335.                          still be a border, but it will be made of space
  21336.                          characters.
  21337.  
  21338.  
  21339.      Border Color=       DOS Only.  Sets the color for the border lines, but not
  21340.                          the title at the top of the window.  The mouse "Close
  21341.                          block" is also drawn using the border color.  Under
  21342.                          Windows the border color is a system control.
  21343.  
  21344.      Title Color=        DOS Only.  Sets the color for the title.   Under
  21345.                          windows this is a system control. 
  21346.  
  21347.      Shadow Color=       DOS Only.  Sets the color for text in the shadow of a
  21348.                          window.  Under windows there are no shadows.  If you
  21349.                          set this to nothing, no shadows are displayed.
  21350.  
  21351.      Message Color=      DOS and Windows.  Sets the color used by the Win:Msg
  21352.                          function for messages.
  21353.  
  21354.      Normal Color=       DOS and Windows.  Sets the color used by normal text in
  21355.                          the window.
  21356.  
  21357.      Low Color=          DOS and Windows.  Sets the color used by Win:Att(2),
  21358.                          and also  by  inactive menu option letters.  Under
  21359.                          windows, pull down menus use the default system colors.
  21360.  
  21361.      Medium Color=       DOS and Windows.  Sets the color used by Win:Att(3),
  21362.                          and also  by  lines within menus and group boxes.
  21363.  
  21364.      High Color=         DOS and Windows.  Sets the color used by Win:Att(4),
  21365.                          and also  by  active menu lines, and inactive input
  21366.                          fields. 
  21367.  
  21368.      Bold Color=         DOS and Windows.  Sets the color used by Win:Att(5),
  21369.                          and also  by  active menu option letters, and active
  21370.                          input fields.  
  21371.  
  21372.  
  21373.  
  21374.  
  21375.  
  21376.  
  21377.  
  21378.  
  21379.  
  21380.  
  21381.  
  21382.           Appendix                                                      343
  21383.  
  21384.  
  21385.  
  21386.  
  21387.  
  21388.  
  21389.  
  21390.  
  21391.                                   Foreground Colors 
  21392.  
  21393.      Black                    Blue           Green               Cyan
  21394.      Red                      Magenta        Brown               White (Gray)
  21395.      Gray (Darker Gray)       Light Blue     Light Green         Light Cyan
  21396.      Light Red                Light Magenta  Yellow              Bright White
  21397.  
  21398.                                   Background Colors
  21399.  
  21400.      Black                    Blue           Green               Cyan
  21401.      Red                      Magenta        Brown               White (Gray)
  21402.      *Gray (Darker Gray)      *Light Blue    *Light Green        *Light Cyan
  21403.      *Light Red               *Light Magenta *Yellow             *Bright White
  21404.  
  21405.      * These background colors cannot be displayed on CGA monitors.  Instead,
  21406.      the color will blink and be really obnoxious.  Be certain your user is
  21407.      using EGA or VGA before using these colors.
  21408.  
  21409.  
  21410.  
  21411.  
  21412.  
  21413.  
  21414.  
  21415.  
  21416.  
  21417.  
  21418.  
  21419.  
  21420.  
  21421.  
  21422.  
  21423.  
  21424.  
  21425.  
  21426.  
  21427.  
  21428.  
  21429.  
  21430.  
  21431.  
  21432.  
  21433.  
  21434.  
  21435.  
  21436.  
  21437.  
  21438.  
  21439.  
  21440.  
  21441.  
  21442.  
  21443.           The JORF Manual (Shareware Disk Version)                      344
  21444.  
  21445.  
  21446.  
  21447.  
  21448.  
  21449.  
  21450.  
  21451.  
  21452.  
  21453.  
  21454.  
  21455.  
  21456.                                Appendix E - JORF Errors
  21457.  
  21458.  
  21459.  
  21460.  
  21461.  
  21462.                                      JORF Errors
  21463.  
  21464.      The following is a list of JORF errors.  When an error is displayed, the
  21465.      offending program line is also displayed.  If there is a DOS error to
  21466.      report, it is reported.
  21467.  
  21468.      In this list, the module name is identified.  This is my own reference, and
  21469.      has little meaning except to group errors with a task.  (For instance, all
  21470.      errors with a module of JDB relate to dBASE file functions.)
  21471.  
  21472.      Some errors are marked Info.  These errors are considered debugging tools,
  21473.      (for when I am debugging the interpreter) and will not be displayed unless
  21474.      you have Mem Stats=Yes in your INI file.  
  21475.  
  21476.      Some errors are marked Fatal.  These errors will cause the program to
  21477.      abort.  They cannot be trapped by any error system.  They are generally
  21478.      initialization errors (Not enough DOS memory, cannot Init CGA driver).  The
  21479.      rest are memory or data corrupt errors that you should never see.  If you
  21480.      create a program that corrupts memory and produces a fatal error, please
  21481.      send that program to me with instructions on how to reproduce the error. 
  21482.      My goal in JORF is to make it impossible to produce a fatal error.  (As
  21483.      opposed to Clipper where every error is fatal, even something so trivial as
  21484.      a type-mismatch.)
  21485.  
  21486.  
  21487.  
  21488.  
  21489.  
  21490.  
  21491.  
  21492.  
  21493.  
  21494.  
  21495.  
  21496.  
  21497.  
  21498.  
  21499.  
  21500.  
  21501.  
  21502.  
  21503.  
  21504.           Appendix                                                      345
  21505.  
  21506.  
  21507.  
  21508.  
  21509.  
  21510.  
  21511.  
  21512.      Error  Module          Description
  21513.  
  21514.      101    JCLASS          Could not delete method METHODNAME
  21515.      102    JCLASS          Could not delete method METHODNAME
  21516.  
  21517.                             Method:Del was called, but the indicated method was
  21518.                             not indexed in the JRF file. 
  21519.  
  21520.      103    JCLASS          Can't read FILENAME
  21521.  
  21522.                             Unable to read file.  See DOS error message.
  21523.  
  21524.      105    JF              Cannot open file FILENAME
  21525.  
  21526.                             Unable to open file. See DOS error message.
  21527.  
  21528.      106    JF              File FILENUMBER not found.
  21529.  
  21530.                             A record referenced a file by number, that file was
  21531.                             not found.  Files are numbered according to when
  21532.                             they are opened.  File one is always SWAPFILE.JRF
  21533.                             where the program stack and temporary variables are
  21534.                             stored.  File two is the start-up program file.
  21535.  
  21536.                             The common reason for this error is that a record
  21537.                             number was corrupted in memory.  Since the JORF
  21538.                             language does a lot of memory operations, memory
  21539.                             variables are particularly susceptible to this kind
  21540.                             of problem.  
  21541.  
  21542.                             One thing that I know makes this error happen is
  21543.                             trying to read and allocate many strings greater
  21544.                             than 10K in size. For some reason, the Borland
  21545.                             MALLOC fails (or I fail in some way) when you
  21546.                             allocate and deallocate 20K far buffers more than
  21547.                             about 50 times.  Since the JORF File read routines
  21548.                             are constantly converting buffers into JORF pointers
  21549.                             (thereby allocating memory) this causes this malloc
  21550.                             problem to appear.  
  21551.  
  21552.                             There may be other causes, and I am always striving
  21553.                             to insure that this error never happens.  If you can
  21554.                             make it happen "on-call", please send me the program
  21555.                             so I can fix the problem.  Thank-you.
  21556.  
  21557.      107    JF - Info       File 0 error record NNN
  21558.  
  21559.                             Same as 106 except that the record pointer is zero.
  21560.  
  21561.  
  21562.  
  21563.  
  21564.  
  21565.           The JORF Manual (Shareware Disk Version)                      346
  21566.  
  21567.  
  21568.  
  21569.  
  21570.  
  21571.  
  21572.  
  21573.      Error  Module          Description
  21574.  
  21575.      108    JF - Info       Delete root not deleted in FILENAME
  21576.      109    JF - Info       Delete root not deleted in FILENAME
  21577.      110    JF - Info       Bad delete root in FILENAME
  21578.  
  21579.                             These three errors appear if the program locked up
  21580.                             in single user mode.  In this mode, file headers
  21581.                             (and the delete root) are not written until the
  21582.                             program terminates normally.  Since the program did
  21583.                             not terminate normally, the delete root is
  21584.                             incorrect, and the error is simply a message that
  21585.                             the delete list will be restarted.  No data is lost,
  21586.                             just deleted buffers will not be recovered until the
  21587.                             next pack operation.
  21588.  
  21589.                             These errors are INFO errors, meaning that they will
  21590.                             only be displayed if you have Mem Status = Yes in
  21591.                             the INI file.  Because no data is lost, I felt it
  21592.                             was not necessary to display the error normally.
  21593.  
  21594.                             Having this error occur on a file that was closed
  21595.                             properly means that the information written to file
  21596.                             is corrupt, which is a true error, but corrupted
  21597.                             files will exhibit other errors that will be
  21598.                             reported. 
  21599.  
  21600.      111    JF - Fatal      Illegal record flag at POS in FILENAME
  21601.  
  21602.                             Corrupted file.  If this is a program file, erase
  21603.                             the JRF file and reload from the source.  If this is
  21604.                             a data file, rebuild the file using the -R flag:
  21605.  
  21606.                                JORF CLASSNAME -R FILENAME
  21607.  
  21608.                             The CLASSDEF must be the program file that contains
  21609.                             the class definitions for the indexes.  There may be
  21610.                             more than one CLASSDEF file, and these files are not
  21611.                             rebuilt. Every file named after -R is rebuilt.
  21612.  
  21613.      112    JF - Info       Attempt to read deleted record in FILENAME
  21614.  
  21615.                             Normally you don't see this because it is an INFO
  21616.                             error.  However, I have found some combinations of
  21617.                             array pointers to structures, and structure pointers
  21618.                             to arrays, where the automatic garbage collection
  21619.                             function during the flush operation was deleting a
  21620.                             little too much data, and the symptom was this error
  21621.                             when the program tried to reference the cleaned
  21622.                             data.  If you have a recurring case where this is a
  21623.                             problem.  Please send me the program.  Thank-You.
  21624.  
  21625.  
  21626.           Appendix                                                      347
  21627.  
  21628.  
  21629.  
  21630.  
  21631.  
  21632.  
  21633.  
  21634.      Error  Module          Description
  21635.  
  21636.      113    JF              File FILENAME not locked
  21637.  
  21638.                             Record locking must not be working properly on your
  21639.                             system or network.  Please contact me to help me get
  21640.                             the locking working correctly.  Naturally, I have
  21641.                             been too poor to buy every network to test this
  21642.                             product.
  21643.  
  21644.      115    JF - Info       Record 0 Error in FILENAME
  21645.  
  21646.                             Data corrupt, see 106.
  21647.  
  21648.      114    JF              File FILENUMBER not found
  21649.  
  21650.                             Data corrupt, see 106.
  21651.  
  21652.      116    JBLOCK          Can't read FILENAME
  21653.  
  21654.                             Block read, incorrect file name.  See DOS error.
  21655.  
  21656.      117    JBLOCK          Can't open FILENAME for block write
  21657.      118    JBLOCK          Can't write block to FILENAME
  21658.  
  21659.                             Block write, could not open.  See DOS error.
  21660.  
  21661.      119    JBLOCK          Unknown Win:Block command COMMAND
  21662.  
  21663.                             See reference guide for valid command strings.
  21664.  
  21665.      121    JCLASSDI        Can't write to DATAPATH
  21666.  
  21667.                             Attempted to write program file, but couldn't.  See
  21668.                             DOS error.
  21669.  
  21670.      122    JFILE - Info    Can't free FILENAME
  21671.  
  21672.                             Unable to clean up after method that accessed a new
  21673.                             file.  I've never seen this one, and you shouldn't
  21674.                             either.  As usual, if you see this at all, please
  21675.                             send me the program so I can investigate.  May be a
  21676.                             memory corrupt, see 106.
  21677.  
  21678.      123    JFILE            Can't open file FILENAME
  21679.  
  21680.                             Could be illegal character in the name, or a sharing
  21681.                             violation. See DOS error.
  21682.  
  21683.      128    JFOPEN          Can't close file FILENAME
  21684.  
  21685.                             Tell me.  Should never happen.  See DOS error.
  21686.  
  21687.           The JORF Manual (Shareware Disk Version)                      348
  21688.  
  21689.  
  21690.  
  21691.  
  21692.  
  21693.  
  21694.  
  21695.      Error  Module          Description
  21696.  
  21697.      129    JFRENAME        Cannot rename file FILENAME
  21698.  
  21699.                             Probably illegal character or sharing violation, See
  21700.                             DOS error.
  21701.  
  21702.      130    JFOPEN          Cannot back up file FILENAME
  21703.  
  21704.                             File:Backup failed, see DOS error.
  21705.  
  21706.      131    JFOPEN - Info   Cannot unlink file
  21707.  
  21708.                             Memory corrupt?  See 106.
  21709.  
  21710.      133    JFOPEN          Could not read file buffer length LENGTH
  21711.      134    JFOPEN          Could not read file buffer length LENGTH
  21712.  
  21713.                             See DOS error.  Mostly indicates a case where the
  21714.                             program wants to read 512 bytes, and DOS only gives
  21715.                             back 422 bytes or something.
  21716.  
  21717.      135    JFOPEN - Info   Cannot resize file FILENAME
  21718.  
  21719.                             Could not reset size of file.  See DOS error.
  21720.  
  21721.      136    JFOPEN - Info   Seek error byte POS
  21722.      137    JFOPEN - Info   Cannot seek to byte POS in file FILENAME
  21723.      138    JFOPEN          Cannot seek file FILENAME
  21724.  
  21725.                             Usually memory corrupt (see 106) causes a record
  21726.                             pointer to come out with an outrageous record
  21727.                             position (like 100 gigabytes past the beginning of
  21728.                             the file).  The Position is the seek-to position, so
  21729.                             you can see whether this is the case.  
  21730.  
  21731.                             I have also seen this error in cases where a program
  21732.                             deleted an active data file while there were active
  21733.                             pointers to that file. 
  21734.  
  21735.  
  21736.  
  21737.  
  21738.  
  21739.  
  21740.  
  21741.  
  21742.  
  21743.  
  21744.  
  21745.  
  21746.  
  21747.  
  21748.           Appendix                                                      349
  21749.  
  21750.  
  21751.  
  21752.  
  21753.  
  21754.  
  21755.  
  21756.      Error  Module          Description
  21757.  
  21758.      139    JFOPEN          Record size SIZE is too long, limit MAX in file
  21759.  
  21760.                             There is a limit to the largest buffer you can read
  21761.                             in JORF.  It changes, and is closely linked to my
  21762.                             problems with Borland Malloc/Free failing when you
  21763.                             thrash around with buffers greater than 10K.  For
  21764.                             that reason, 2.1 is shipping with a max file buffer
  21765.                             size of 10K.  However, if Borland fixes this
  21766.                             problem, I want to increase the buffer size to 32K.
  21767.  
  21768.                             If you need to read a large buffer, why not find a
  21769.                             way to map the file into 5K chunks and read in 5K
  21770.                             segments.   
  21771.  
  21772.      140    JFOPEN          Cannot Read in file FILENAME.
  21773.  
  21774.                             We asked DOS to read 512 bytes, but DOS only gave us
  21775.                             422 or some other number.  See DOS error.
  21776.  
  21777.      141    JFOPEN          Record size SIZE is too long, limit MAX in file
  21778.  
  21779.                             Same as 139 except this one is when you are writing
  21780.                             a file.
  21781.  
  21782.      142    JFOPEN          Cannot write to file FILENAME
  21783.  
  21784.                             Same as 140 exept when writing a file.  See DOS
  21785.                             error.
  21786.  
  21787.      150    JINI            INI: Unknown color COLOR
  21788.  
  21789.                             See Appendix D for legal color names.
  21790.  
  21791.      151    JINI - Fatal    INI: Unknown command COMMAND
  21792.      152    JINI - Fatal    INI: Equal sign required COMMAND
  21793.      153    JINI - Fatal    INI: unknown command: COMMAND
  21794.  
  21795.                             The first thing the program does is read the INI
  21796.                             file to get settings.  In this case, there was an
  21797.                             incorrect command in the INI file.  You will have to
  21798.                             correct the displayed command.
  21799.  
  21800.      154    JINI - Fatal    INI: Cannot read file FILENAME
  21801.  
  21802.                             If the file were simply not found, a default INI
  21803.                             file is written and no error appears.  This error
  21804.                             indicates that the INI file is there, but somehow
  21805.                             locked so it cannot be read.  See DOS error. 
  21806.  
  21807.  
  21808.  
  21809.           The JORF Manual (Shareware Disk Version)                      350
  21810.  
  21811.  
  21812.  
  21813.  
  21814.  
  21815.  
  21816.  
  21817.      Error  Module          Description
  21818.  
  21819.      155    JINI - Fatal    INI: Cannot use multiuser mode without SHARE.EXE. 
  21820.      156    JINI - Fatal    INI: To run another instance of JORF you must set
  21821.                             'Multiuser=Yes' in the INI file
  21822.  
  21823.                             These two are related.  The second appears under
  21824.                             Windows if you try to load the same JORF module
  21825.                             twice.  The first appears if you try to run
  21826.                             Multiuser = Yes without SHARE.EXE loaded.  If you
  21827.                             want to run in multi-user mode, you must load SHARE. 
  21828.                             See your DOS manual for further instructions on
  21829.                             SHARE.
  21830.  
  21831.      157    JINI - Fatal    INI: Cannot write file FILENAME
  21832.  
  21833.                             When no INI file is found, a default INI file is
  21834.                             written.  This error means that you do not have
  21835.                             write permission on the current directory.  Check
  21836.                             your network rights. 
  21837.  
  21838.      200    JM - Fatal      Cannot load cache
  21839.  
  21840.                             Ran out of memory on a very basic start-up
  21841.                             operation.  Check memory.
  21842.  
  21843.      201    JFLUSH - Fatal  Cannot reload memory
  21844.      202    JFLUSH - Fatal  NDEL buffer exceeded
  21845.  
  21846.                             These are equivalent to an out-of-memory in a
  21847.                             language like C.  In this case, the virtual memory
  21848.                             system's tables are being exceeded because you have
  21849.                             a) too deep a stack, b) too many items in the stack,
  21850.                             c) too many functions compiled in a application or
  21851.                             d) something else.  While I have tried to adjust
  21852.                             these tables so that you will never see these
  21853.                             errors, the can occur and that means the table sizes
  21854.                             need further adjustment.
  21855.  
  21856.                             Naturally, I want this program to work for you.  If
  21857.                             you see either of these errors, please send me the
  21858.                             program and I will try to adjust the table size to
  21859.                             accommodate your needs.
  21860.  
  21861.      220    JDB  Cannot create index NTXNAME
  21862.  
  21863.                             Probably a bad file name or sharing violation, see
  21864.                             DOS error.
  21865.  
  21866.      221    JDB  File FILENAME is not dBASE III
  21867.  
  21868.                             JORF cannot handle dBASE IV files.
  21869.  
  21870.           Appendix                                                      351
  21871.  
  21872.  
  21873.  
  21874.  
  21875.  
  21876.  
  21877.  
  21878.      Error  Module          Description
  21879.  
  21880.      222    JDB  File FILENAME not mapped in function
  21881.  
  21882.                             You attempted a DB operator without mapping the file
  21883.                             as a dBASE file.  The mapping is required before you
  21884.                             can read or write to a dBASE file.
  21885.  
  21886.      223    JDB  File FILENAME not found. Use Db:Create to create it.
  21887.  
  21888.                             File not found.  
  21889.  
  21890.      224    JDB  Cannot open FILENAME
  21891.  
  21892.                             File was found, but could not be opened.  Locking? 
  21893.                             Out of handles?  See DOS error.
  21894.  
  21895.  
  21896.      225    JDB  Cannot find file DBTNAME
  21897.      226    JDB  Cannot open file DBTNAME
  21898.  
  21899.                             Found the DBF file, but not the matching DBT file. 
  21900.                             Whenever you copy a DBF with memo fields, you must
  21901.                             also copy the DBT file. 
  21902.  
  21903.      227    JDB  NTX Order number too high
  21904.  
  21905.                             Attempt to DB:SetOrder to an index number too high. 
  21906.                             If you have three NTX file, you cannot
  21907.                             DB:SetOrder(4) because there is no NTX number four. 
  21908.                             That is all.
  21909.  
  21910.      228    JNTX Underflow count COUNT at POS
  21911.      229    JT              Underflow count COUNT at POS
  21912.  
  21913.                             File corrupt.  In error 228 it is with an NTX file. 
  21914.                             In error 229 it is in a JRF file.  The file must be
  21915.                             rebuilt.
  21916.  
  21917.      280    JPACK           Can't write to pack file FILENAME
  21918.      281    JPACK           Can't read pack file FILENAME
  21919.  
  21920.                             Problems during JORF Rebuild.  See DOS error. 
  21921.  
  21922.      282    JPACK           Can't find count in pack file FILENAME.
  21923.  
  21924.                             Problems reading pack file, or pack file is wrong
  21925.                             format.  See DOS error.
  21926.  
  21927.      283    JPACK           Cannot rebuild swap file
  21928.  
  21929.                             The SWAPFILE.JRF file cannot be packed.
  21930.  
  21931.           The JORF Manual (Shareware Disk Version)                      352
  21932.  
  21933.  
  21934.  
  21935.  
  21936.  
  21937.  
  21938.  
  21939.      Error  Module          Description
  21940.  
  21941.      284    JPACK           Cannot rebuild active program
  21942.  
  21943.                             To rebuild a program file, write the source, erase
  21944.                             the JRF file, and the interpreter will automatically
  21945.                             re-read the source.  You cannot rebuild a source
  21946.                             file using JORF:REBUILD.
  21947.  
  21948.      301    JCALL           Too many ops
  21949.  
  21950.                             In a compiled application a JMATH() call had too
  21951.                             many operations.  Please keep each math expression
  21952.                             simple.
  21953.  
  21954.      302    JIF   Misplaced 'else'
  21955.  
  21956.                             Found ELSE with no matching IF statement.
  21957.  
  21958.      303    JIF  Use "thru" not "to"
  21959.      304    JIF  Bad syntax for "=" in For function
  21960.      305    JIF  Missing value ENDVALUE in For function
  21961.      306    JIF  Lost value ENDVALUE in For function
  21962.  
  21963.                             In a FOR () statement there was a syntax error. 
  21964.                             Basic programmers will get the first one a lot,
  21965.                             until you understand how incorrect "To" can be. 
  21966.                             (When you say For (i = 1 to 10) do you mean to end
  21967.                             at 9 or 10?)
  21968.  
  21969.      310    JFMAP           Illegal file map type MAPTYPE
  21970.  
  21971.                             See reference section for File:Map for list of legal
  21972.                             file types.  You must have misspelled something
  21973.                             here.
  21974.  
  21975.      312    JFMAP           Missing file map for FILENAME
  21976.  
  21977.                             A dBASE file requires a map before you can create
  21978.                             it.  You can read the file without a map, because
  21979.                             the file will be mapped from the file header, but
  21980.                             you cannot create a file you have not yet defined. 
  21981.  
  21982.      313    JFMAP           Map width WID is too long, limit MAX in file.
  21983.  
  21984.                             There is a limit to buffer size.  See Error 139.
  21985.  
  21986.  
  21987.  
  21988.  
  21989.  
  21990.  
  21991.  
  21992.           Appendix                                                      353
  21993.  
  21994.  
  21995.  
  21996.  
  21997.  
  21998.  
  21999.  
  22000.      Error  Module          Description
  22001.  
  22002.      320    JMALLOC - Fatal             Out of Memory
  22003.  
  22004.                             Dead!  The virtual memory system should keep this
  22005.                             from happening.  Getting this error means that you
  22006.                             have circumvented the automatic heap checking system
  22007.                             and caused the program to allocate more memory than
  22008.                             is available.
  22009.  
  22010.                             Check DOS memory.  If you have only 540K or less
  22011.                             free, you can probably fix this by clearing enough
  22012.                             AUTOEXEC stuff to get 560K free.  Try removing
  22013.                             ANSI.SYS, and any TSR programs that use a lot of
  22014.                             memory.  Under DOS 5.0 you can examine memory using
  22015.                             the MEM command (see your DOS manual).  
  22016.  
  22017.                             If you have a known operation that will use a lot of
  22018.                             memory (like reading a 10K record buffer)  you may
  22019.                             want to do a partial memory flush ahead of time. 
  22020.                             Try Jorf:Flush(50) before this operation, to flush
  22021.                             memory if there is not 50K available.
  22022.  
  22023.                             The reason you may need 50K is that the buffer takes
  22024.                             10K, when the buffer is turned into a JORF pointer
  22025.                             uses 10K, and 30K free space is not unreasonable for
  22026.                             the other tasks like executing the next program line
  22027.                             or calling another function.  
  22028.  
  22029.      321    JMALLOC - Fatal             Address zero changed
  22030.  
  22031.                             I usually compile this one out before distribution,
  22032.                             so you will not see it.  Because JORF is written in
  22033.                             C, and null pointers in C cause address zero to
  22034.                             change, I have a running check of the value to make
  22035.                             sure JORF is well behaved.  
  22036.  
  22037.  
  22038.  
  22039.  
  22040.  
  22041.  
  22042.  
  22043.  
  22044.  
  22045.  
  22046.  
  22047.  
  22048.  
  22049.  
  22050.  
  22051.  
  22052.  
  22053.           The JORF Manual (Shareware Disk Version)                      354
  22054.  
  22055.  
  22056.  
  22057.  
  22058.  
  22059.  
  22060.  
  22061.      Error  Module          Description
  22062.  
  22063.      324    JMALLOC - Fatal             Cannot unlink memory!
  22064.      325    JMALLOC - Info  Bad free offset from LOCATION
  22065.      326    JMALLOC - Info  Buffer already freed: LOCATION at LOCATION
  22066.      328    JMALLOC - Info  Buffer overrun:  LOCATION at LOCATION
  22067.  
  22068.                             To see any of these you need Mem Status = Yes in
  22069.                             your INI file.  These are things I watch as I
  22070.                             develop each command, to try to ferret out memory
  22071.                             corruption problems.
  22072.  
  22073.                             With Mem Status = Yes the Malloc buffers are linked
  22074.                             into a list, so that when the program ends I can be
  22075.                             sure that every buffer has been freed (a sign that
  22076.                             all buffers are written properly.)  the Cannot
  22077.                             Unlink error used to mean that a buffer was
  22078.                             allocated wrong, but lately I only see it associated
  22079.                             with general memory corruptions caused by reading
  22080.                             20K buffers from file.  (Shrinking the max buffer
  22081.                             size eliminated the problem, hence the limit in
  22082.                             Error 139)
  22083.  
  22084.                             Compiled Windows Programs exhibiting these errors
  22085.                             should check the STACKSIZE command in the DEF file. 
  22086.                             These errors are a symptom of a stack/heap crash,
  22087.                             and shrinking the STACKSIZE may help this problem.
  22088.  
  22089.                             All Mallocs and Frees under JORF are labeled with
  22090.                             short strings for identification, so "Buffer Already
  22091.                             Freed JARR at JFR" tells me that the buffer was
  22092.                             allocated as a structure (JARR) and was being
  22093.                             deallocated by the general JORF Pointer free routine
  22094.                             (JFR).  This system helps me track memory problems.
  22095.  
  22096.      329    JMALLOC - Fatal             Out of Memory
  22097.  
  22098.                             Same as 320 except with near heap, not far.
  22099.  
  22100.      330    JMALLOC - Info              Buffer already freed: LOCATION at
  22101.      LOCATION
  22102.      331    JMALLOC - Info              Buffer overrun:     LOCATION at LOCATION
  22103.  
  22104.                             Same as 326 and 328 except with near heap, not far.
  22105.  
  22106.      332    JMALLOC - Fatal             Insufficient DOS Memory
  22107.  
  22108.                             You gotta have 560K free to run JORF well.  On an
  22109.                             old XT computer, you need to be running DOS 3.3 or
  22110.                             lower with few TSR programs.   On AT and 386
  22111.                             computers, you need to load DOS high to free up
  22112.                             enough memory.
  22113.  
  22114.           Appendix                                                      355
  22115.  
  22116.  
  22117.  
  22118.  
  22119.  
  22120.  
  22121.  
  22122.  
  22123.  
  22124.  
  22125.  
  22126.  
  22127.  
  22128.  
  22129.  
  22130.  
  22131.  
  22132.  
  22133.  
  22134.  
  22135.  
  22136.  
  22137.  
  22138.  
  22139.  
  22140.  
  22141.  
  22142.  
  22143.  
  22144.  
  22145.  
  22146.  
  22147.  
  22148.  
  22149.  
  22150.  
  22151.  
  22152.  
  22153.  
  22154.  
  22155.  
  22156.  
  22157.  
  22158.  
  22159.  
  22160.  
  22161.  
  22162.  
  22163.  
  22164.  
  22165.  
  22166.  
  22167.  
  22168.  
  22169.  
  22170.  
  22171.  
  22172.  
  22173.  
  22174.  
  22175.           The JORF Manual (Shareware Disk Version)                      356
  22176.  
  22177.  
  22178.  
  22179.  
  22180.  
  22181.  
  22182.  
  22183.      Error  Module          Description
  22184.  
  22185.      334    JARRINI         Cannot exceed WORDMAX elements in structure or line
  22186.  
  22187.                             There is a limit to the number of elements in a
  22188.                             structure.  I change it around, but currently it is
  22189.                             256 or 512 depending on my mood.  A structure can
  22190.                             always point to a sub-structure to increase the
  22191.                             number of elements infinitely.
  22192.  
  22193.      401    JWRITE          Attempt to write stack
  22194.  
  22195.                             You got some mixed up pointer here.  Tell me how you
  22196.                             did it.
  22197.  
  22198.  
  22199.      402    JWRITE          Bad flag in newcopy
  22200.  
  22201.                             Probably a file corruption.  Rebuild it.
  22202.  
  22203.      404    JREAD            Lost text top
  22204.  
  22205.                             Text is sparse in memory.  This means that in memory
  22206.                             is the current line of text, and the top line of
  22207.                             text, but maybe not all lines in between.  This
  22208.                             system allows access to text that is longer than
  22209.                             available memory size.
  22210.  
  22211.                             Something has happened so the current line is still
  22212.                             available, but the top line has been deleted.  Tell
  22213.                             me how you did it, and I will fix it.  You should
  22214.                             never see this error.
  22215.  
  22216.      405    JREAD           Bad record
  22217.      406    JREAD           Bad word count
  22218.  
  22219.                             Read a record from the data file and it was not what
  22220.                             it should have been.  Something has overwritten this
  22221.                             part of the file or something.  Try rebuilding.
  22222.  
  22223.      408    JREAD           Cannot read line LINEPOS of text
  22224.  
  22225.                             Something has happened to text where a line does not
  22226.                             exist.  This is pretty difficult, and may be related
  22227.                             to a data corruption.  Use to be you could do this
  22228.                             by block moving or deleting so that the text was
  22229.                             really shifted around.  This should all be fixed
  22230.                             now.  If not, tell me.
  22231.  
  22232.  
  22233.  
  22234.  
  22235.  
  22236.           Appendix                                                      357
  22237.  
  22238.  
  22239.  
  22240.  
  22241.  
  22242.  
  22243.  
  22244.      Error  Module          Description
  22245.  
  22246.      602    JMARRAY         Illegal brackets for array
  22247.      604    JMARRAY         Missing [ in array
  22248.  
  22249.                             Array index must have one [ left bracket and one ]
  22250.                             right bracket.
  22251.  
  22252.      605    JMBINARY        Illegal unary operation
  22253.  
  22254.                             Unary operations are ++a, --p, or negation.  You
  22255.                             tried something that is not legal.  Stick to the
  22256.                             legal ones please.
  22257.  
  22258.      606    JMARRAY         Not an Array
  22259.      607    JMENUARR        Not an Array in "Arr:Pick".
  22260.  
  22261.                             Arr:Sort and Arr:Pick require arrays.  One way to
  22262.                             check before this error appears is to be sure that
  22263.                             Arr:Len is greater than one.
  22264.  
  22265.      702    JA              Unable to move SOURCE to DEST
  22266.  
  22267.                             Some problem with the obscure Jorf:Move function.
  22268.  
  22269.      708    JFNC Can't find Class: CLASSNAME
  22270.  
  22271.                             Class definition is not found in any of the
  22272.                             currently opened files.
  22273.  
  22274.      710    JA              Can't find METHODNAME
  22275.  
  22276.                             Method is not found in any of the currently opened
  22277.                             files.
  22278.  
  22279.      711    JA              Attempt to seek null element in class CLASSNAME
  22280.                             The Member label is null for some reason, like to
  22281.                             said A->"" = B or something.
  22282.  
  22283.      712    JA              Element MEMBERNAME is not a member of Class
  22284.                             CLASSNAME
  22285.      713    JA              Element MEMBERNAME is not a member of Class
  22286.                             CLASSNAME
  22287.  
  22288.                             Attempt to assign a member that is not in class
  22289.                             defintion.  Only the JORF class can take any member
  22290.                             name, other classes must have all members declared
  22291.                             in the class definition.
  22292.  
  22293.      714    JA              Attempt to seek null element in class CLASSNAME
  22294.  
  22295.                             See 711.
  22296.  
  22297.           The JORF Manual (Shareware Disk Version)                      358
  22298.  
  22299.  
  22300.  
  22301.  
  22302.  
  22303.  
  22304.  
  22305.      Error  Module          Description
  22306.  
  22307.      715    JA              Assignment of stack
  22308.  
  22309.                             See 401
  22310.  
  22311.      716    JA              Element MEMBERNAME is not a member of Class
  22312.                             CLASSNAME
  22313.  
  22314.                             See 713
  22315.  
  22316.      716    JCPY Bad word data
  22317.  
  22318.                             Some kind of memory corruption.  This one is usually
  22319.                             pretty regular.  Please send me the program, because
  22320.                             this can be easily fixed once I see how you produce
  22321.                             it.
  22322.  
  22323.      721    JMAGIC          Mismatched brackets in EXPRESSION
  22324.  
  22325.                             Curly brackets must be in sets.  To print a curly
  22326.                             bracket with magic on, print it as a constant {"{"}.
  22327.  
  22328.      722    JMAGIC          Exceeded buffer size (512 Bytes)
  22329.  
  22330.                             Buffers with curly brackets cannot be longer than
  22331.                             512 bytes.
  22332.  
  22333.      720    JTRACE          Too many break points
  22334.  
  22335.                             You can only set about 10 break points while
  22336.                             debugging a program (or is it 20? can't decide). 
  22337.                             Try unsetting one or two.
  22338.  
  22339.      723    JPARSE          Mismatched parentheses: EXPRESSION
  22340.  
  22341.                             Expressions must have matched parentheses.
  22342.  
  22343.      730    JWPARSE         Unknown window item ITEM
  22344.  
  22345.                             Perhaps you window definition got so long that you
  22346.                             got confused and did not outdent the next program
  22347.                             line.  
  22348.  
  22349.      731    JWPARSE - Fatal             Exceeded count
  22350.  
  22351.                             Unlikely to ever see this, but it has to do with the
  22352.                             count of prompted items in hypertext.  Send program
  22353.                             if you see this at all. I will fix.
  22354.  
  22355.      741    JI              Unknown variable or method LABEL
  22356.  
  22357.  
  22358.           Appendix                                                      359
  22359.  
  22360.  
  22361.  
  22362.  
  22363.  
  22364.  
  22365.  
  22366.                             Couldn't even decide if this is a Method, Variable
  22367.                             or Function call.
  22368.  
  22369.  
  22370.  
  22371.  
  22372.  
  22373.  
  22374.  
  22375.  
  22376.  
  22377.  
  22378.  
  22379.  
  22380.  
  22381.  
  22382.  
  22383.  
  22384.  
  22385.  
  22386.  
  22387.  
  22388.  
  22389.  
  22390.  
  22391.  
  22392.  
  22393.  
  22394.  
  22395.  
  22396.  
  22397.  
  22398.  
  22399.  
  22400.  
  22401.  
  22402.  
  22403.  
  22404.  
  22405.  
  22406.  
  22407.  
  22408.  
  22409.  
  22410.  
  22411.  
  22412.  
  22413.  
  22414.  
  22415.  
  22416.  
  22417.  
  22418.  
  22419.           The JORF Manual (Shareware Disk Version)                      360
  22420.  
  22421.  
  22422.  
  22423.  
  22424.  
  22425.  
  22426.  
  22427.      Error  Module          Description
  22428.  
  22429.      742    JI              Don't know how to COMMAND
  22430.  
  22431.                             Decided this was a Method or Function, but don't
  22432.                             know how to call it (cannot find it).
  22433.  
  22434.      743    JI              Too many parameters (limit 10) in function call
  22435.  
  22436.                             Currently a limit of 10 parameters.
  22437.  
  22438.      744    JI - Fatal      Lost name, now METHODNAME
  22439.  
  22440.                             A speed optimization has gone awry.  Send me the
  22441.                             program.
  22442.  
  22443.      745    JI              Cannot find method METHODNAME
  22444.  
  22445.                             Program knows it is a method, but cannot find it in
  22446.                             any of the currently opened program files.
  22447.  
  22448.      747    JI              New is not at method top
  22449.  
  22450.                             New() must be the first line of the method. 
  22451.  
  22452.      801    JMESSAGE        Unknown message type MESSAGETYPE
  22453.  
  22454.                             See Msg:Add for list of valid types.
  22455.  
  22456.      802    JS              Can't set attribute ATTRIBUTE
  22457.  
  22458.                             See Win:Attr for valid Attribute syntax.
  22459.  
  22460.      805    JS              Can't set justification FLRCO
  22461.  
  22462.                             See Win:FLRCO for valid FLRCO letters.  I'll give
  22463.                             you a hint - they are F-L-R-C and O!
  22464.  
  22465.      808    JSADD           Too many windows, limit 512
  22466.  
  22467.                             Mike B. Memorial error message.  His first program
  22468.                             displayed 3000 empty windows, ran out of memory. 
  22469.                             Limiting to 512 windows "fixed" the problem.
  22470.  
  22471.      809    JSINP           Input line too long (512 character max)
  22472.  
  22473.                             Single line inputs cannot exceed 512 characters.
  22474.  
  22475.  
  22476.  
  22477.  
  22478.  
  22479.  
  22480.           Appendix                                                      361
  22481.  
  22482.  
  22483.  
  22484.  
  22485.  
  22486.  
  22487.  
  22488.      Error  Module          Description
  22489.  
  22490.      812    JSL - Fatal     Graphic error: GRAPH_ERR_MESSAGE
  22491.  
  22492.                             The GRAPH_ERR_MESSAGE should tell you more.  Usually
  22493.                             a missing BGI file or something.  Only the VGA
  22494.                             driver is compiled into the JORF386 program, so if
  22495.                             you are using 8512 or SVGA there could be problems
  22496.                             in graphics mode.
  22497.  
  22498.      813    JSLBKD - Fatal  Cannot allocate background buffer
  22499.  
  22500.                             You know there is a lotta bits in a graphics window,
  22501.                             so when storing the background buffer the program
  22502.                             must malloc and free some big buffers. If there is a
  22503.                             mis-allocation, you will see this error.  Try to run
  22504.                             with more free memory.
  22505.  
  22506.      814    JSLBOX - Fatal  Out of windows memory
  22507.  
  22508.                             Actually, not memory but just displaying problems. 
  22509.                             Could not create a new window.
  22510.  
  22511.      820    JSLCARET        Attempt to create caret without focus
  22512.  
  22513.                             Isn't Windows lingo fun?  Just tell me how you did
  22514.                             it and I will try to fix it.  It is, naturally,
  22515.                             illegal to create your caret if you don't have
  22516.                             focus.
  22517.  
  22518.      821    JSLCARET - Fatal            Image size too large
  22519.  
  22520.                             The blinking cursor image is bigger than the image
  22521.                             buffer.  I am making the buffer big enough now for
  22522.                             all known cursor sizes, so if you see this, I will
  22523.                             need to go bigger than that.  (Tell me what you have
  22524.                             - Super Super VGA?)
  22525.  
  22526.      82     JSLCARET        Attempt to destroy caret without focus
  22527.  
  22528.                             See 820.
  22529.  
  22530.      823    JSLFLUSH        Call to DestroyWindow failed
  22531.  
  22532.                             Microsoft nicely document that DestroyWindow can
  22533.                             fail, but did not say why.  
  22534.  
  22535.  
  22536.  
  22537.  
  22538.  
  22539.  
  22540.  
  22541.           The JORF Manual (Shareware Disk Version)                      362
  22542.  
  22543.  
  22544.  
  22545.  
  22546.  
  22547.  
  22548.  
  22549.      Error  Module          Description
  22550.  
  22551.      824    JSLVMODE - Fatal            Could not register driver
  22552.      825    JSLVMODE - Fatal            Could not register driver
  22553.      826    JSLVMODE - Fatal            CGA graphics not supported
  22554.      827    JSLVMODE - Fatal            PC3270 graphics not supported
  22555.      828    JSLVMODE - Fatal            IBM8514 graphics not supported
  22556.  
  22557.                             First of all, you have GRAPHICS=Yes in your INI
  22558.                             file.  You can make these errors go away if you set
  22559.                             the INI back to GRAPHICS=NO mode.
  22560.  
  22561.                             Second, only VGA graphics is currently supported by
  22562.                             an internal driver.  If you need CGA or 8514
  22563.                             graphics, you must put the appropriate BGI driver on
  22564.                             your JORF directory.  BGI drivers are supplied by
  22565.                             Borland in their Turbo C++ and Borland C++ products.
  22566.  
  22567.      910    JPRINT          Can't print to PRINTER
  22568.      911    JPRINT          Couldn't access PRN
  22569.      912    JPRINT          Printed incomplete string to PRN
  22570.      913    JPRINT          Invalid LPT Printer
  22571.      914    JPRINT          Printer timed out
  22572.      915    JPRINT          Printer out of paper
  22573.      916    JPRINT          Invalid COM Printer
  22574.      917    JPRINT          Can't Print to COM
  22575.      918    JPRINT          Unable to access windows printer PRINTER
  22576.      919    JPRINT          Cannot print file FILENAME
  22577.  
  22578.                             See DOS error, check printer name.
  22579.  
  22580.      920    JREPORT         Unknown Report Item ITEMNAME
  22581.  
  22582.                             See Reference section for Rep:Add. The parser
  22583.                             encountered a command that is not valid.
  22584.  
  22585.      921    JREPORT         Cannot open JREPORT.LST
  22586.  
  22587.                             All reports are written to an output file called
  22588.                             JREPORT.LST.  Something is keeping this file from
  22589.                             being created.  See DOS Error.
  22590.  
  22591.  
  22592.  
  22593.  
  22594.  
  22595.  
  22596.  
  22597.  
  22598.  
  22599.  
  22600.  
  22601.  
  22602.           Appendix                                                      363
  22603.  
  22604.  
  22605.  
  22606.  
  22607.  
  22608.  
  22609.  
  22610.      Error  Module          Description
  22611.  
  22612.      1101   JSYSTEM         Process is busy
  22613.      1102   JSYSTEM         Cannot register Exec class
  22614.      1103   JSYSTEM         Cannot create Exec window
  22615.      1104   JSYSTEM         Cannot register notify proc
  22616.      1106   JSYSTEM         Cannot find Exec task handle
  22617.      1107   JSYSTEM         Error executing "COMMAND"
  22618.  
  22619.                             Windows did not how I set up the Jorf:System()
  22620.                             command.  Please tell me what you are trying to run,
  22621.                             and I will try to investigate.  I program Windows,
  22622.                             but I don't have to like it.
  22623.  
  22624.      1110   JSYSTEM         WINDOWS_MESSAGE executing: COMMAND
  22625.  
  22626.                             Windows did not like your Jorf:System() command. 
  22627.                             Hopefully the MESSAGE it gives back will tell you
  22628.                             what you need to know.  Here is a list of messages:
  22629.  
  22630.                                         Out of memory or Exe file corrupt
  22631.                                         File not found
  22632.                                         Sharing error
  22633.                                         Library required separate data segments
  22634.                                         Out of memory
  22635.                                         Incorrect Windows version
  22636.                                         Invalid Executable file
  22637.                                         App was designed for a different
  22638.                                         Operating System
  22639.                                         App was designed for MS-DOS 4.0
  22640.                                         Type of Executable file unknown
  22641.                                         Cannot load a real-mode application
  22642.                                         Cannot load this program twice
  22643.                                         Cannot load compressed EXE file
  22644.                                         DLL file invalid or corrupt
  22645.                                         App requires 32-bit extensions
  22646.                                         Windows Exec error
  22647.  
  22648.  
  22649.  
  22650.  
  22651.  
  22652.  
  22653.  
  22654.  
  22655.  
  22656.  
  22657.  
  22658.  
  22659.  
  22660.  
  22661.  
  22662.  
  22663.           The JORF Manual (Shareware Disk Version)                      364
  22664.  
  22665.  
  22666.  
  22667.  
  22668.  
  22669.  
  22670.  
  22671.  
  22672.  
  22673.  
  22674.  
  22675.  
  22676.                                Appendix F - DOS Errors
  22677.  
  22678.  
  22679.  
  22680.  
  22681.                                       DOS Errors
  22682.  
  22683.      The following is a list of DOS errors.  DOS errors are almost always
  22684.      related to "Device" operation, like reading from a file or writing to a
  22685.      printer.  This list is standard for all versions of DOS, but there may be
  22686.      differences in the higher numbers on some networks.
  22687.  
  22688.      Error     Description
  22689.  
  22690.      2    File Not Found
  22691.  
  22692.           File is not found or file name contains illegal characters so that the
  22693.           file is not found.  Another possibility is that the specified file is
  22694.           a directory name, and not a complete file name.
  22695.  
  22696.      3    Path Not Found
  22697.  
  22698.           Path does not exist as specified.  Could be illegal characters, but
  22699.           more likely to be a problem with pathing from the root.
  22700.  
  22701.      4    Too many files
  22702.  
  22703.           This is directly related to your FILES= command in CONFIG.SYS.  That
  22704.           command designates a static buffer for all the handles for files open
  22705.           simultaneously on your computer.  Running a program opens three
  22706.           handles, one for STDIN, one for STDOUT, and one for STDERR.  Each
  22707.           additional open file uses one handle. 
  22708.  
  22709.           If you get this error, the simplest solution is to increase your
  22710.           FILES= number to 51 if it is lower, 99 if it is already 51, or 254 if
  22711.           it is already past 99.   Do not increase it beyond 255, DOS limit. 
  22712.           The handles are very small, so adding more handles does not affect
  22713.           your DOS memory very much.
  22714.  
  22715.           You should never see JORF report this error, since it can selectively
  22716.           close files if you run out of handles.   However, if this is the case,
  22717.           you can vastly improve performance by increasing your files to a
  22718.           number high enough to handle all the open files in one application. 
  22719.  
  22720.  
  22721.  
  22722.  
  22723.  
  22724.           Appendix                                                      365
  22725.  
  22726.  
  22727.  
  22728.  
  22729.  
  22730.  
  22731.  
  22732.  
  22733.      5    Access Denied   
  22734.  
  22735.           You do not have sufficient privileges to access this file.  In normal
  22736.           DOS, check ATTRIB (See your DOS manual).  Under a network, check your
  22737.           logon permissions.  Also check to see if someone is using the file
  22738.           (Can't erase a file someone else is using).
  22739.  
  22740.      6    Insufficient Memory
  22741.  
  22742.           I've never seen DOS report this, and suspect it is as old as a 64K IBM
  22743.           PC computer.  
  22744.  
  22745.      15   Invalid Drive Specified
  22746.  
  22747.           Can't specify D: if you have only A:, B: and C:.
  22748.  
  22749.      21   Drive not Ready
  22750.  
  22751.           Close the door to your floppy disk drive.
  22752.  
  22753.      29   Write Fault
  22754.      30   Read Fault
  22755.      31   General Failure 
  22756.  
  22757.           Diskette may be write protected, corrupt or not formatted.  It may be
  22758.           the wrong density for the drive.  It may be a Macintosh disk.
  22759.  
  22760.      32   Sharing Violation
  22761.  
  22762.           Someone has this file in use at the same time as you tried to delete
  22763.           it. 
  22764.  
  22765.      33   Lock Violation
  22766.  
  22767.           Someone has a record locked in this file and you tried to delete it.
  22768.  
  22769.  
  22770.  
  22771.  
  22772.  
  22773.  
  22774.  
  22775.  
  22776.  
  22777.  
  22778.  
  22779.  
  22780.  
  22781.  
  22782.  
  22783.  
  22784.  
  22785.           The JORF Manual (Shareware Disk Version)                      366
  22786.  
  22787.  
  22788.  
  22789.  
  22790.  
  22791.  
  22792.  
  22793.  
  22794.  
  22795.  
  22796.  
  22797.  
  22798.                                         Index
  22799.  
  22800.  
  22801.  
  22802.  
  22803.           .JRF files                   9     Button Handling             12
  22804.           Absolute Value             223     By reference              5, 6
  22805.           Accelerator                 55     By value                     5
  22806.           Add  Watch                  26     Cancel                  21, 23
  22807.           Add dates                  105     Capitalize String          287
  22808.           Add Method             23, 215     Chaining                   172
  22809.           Add Time                   278     Chaining, Program          172
  22810.           Addition (+)                33     Change
  22811.           After                       57          Window Fields         312
  22812.           Alt-F4 Key                  54     Character
  22813.           Append Record              142          Delete                 97
  22814.           Append to dBASE file       115          Get    35, 39, 41-43, 49,
  22815.           Array                       58                                 98
  22816.                Delete                 86          Insert                 99
  22817.                Directory              87          Print            157, 186
  22818.                Insert                 90          Put                   100
  22819.                Length                 91     ChBox                       62
  22820.                Pick                   93     Check Box                   62
  22821.                Printers               94     Class
  22822.                Sort                   95          At               101, 322
  22823.           Arrays                  7, 194          AtDelete              323
  22824.           Arrow Keys                  53          AtInsert              324
  22825.           ASCII file conversion      151          AtPut                 103
  22826.           ASCII Value           286, 288          In               104, 326
  22827.           Assignment (=)              34     Classes                  7, 22
  22828.           Attr                        56     Clear Screen               168
  22829.           Autowatch  Off              30     Clipper Files               10
  22830.           Autowatch On                29     Clock ticks (Time:Ticks)   285
  22831.           Backup File                143     Close file            117, 145
  22832.           Before                      57     Colors                     342
  22833.           Between numbers            224     COM port access            258
  22834.           Binary Files               160     Comma
  22835.           BINARY.J                     5          Decimal               340
  22836.           BIOS Screen Display        339     Comma decimal              235
  22837.           Block Copy                 311     Comma decimal numbers      295
  22838.           Block Read                 311     Continue                   299
  22839.           Block Write                311     Controls                   339
  22840.           BOF in dBASE file          121     Convert Date               113
  22841.           Break                      299     Convert time          282, 296
  22842.           Browser List                93     Converting files      123, 151
  22843.           Buffers                     11     Copy
  22844.           Button                      63          Structures, Text      171
  22845.  
  22846.           Appendix                                                      367
  22847.  
  22848.  
  22849.  
  22850.  
  22851.  
  22852.  
  22853.  
  22854.           Copy File                  146          Jorf Pointers         169
  22855.           Create dBASE file          118          Line                  209
  22856.           Create NTX index           118          Method            24, 216
  22857.           Ctrl-Break                              Structures            169
  22858.                Starting the                       Text                  169
  22859.                     debugger          13     Delete  Watches             29
  22860.           CUA standard                54     Delete Array elements       86
  22861.           Cursor Position            219     Delete dBASE record        119
  22862.           Data Base Manager            7     Deleted record status in
  22863.           Data Fields                 12               dBASE file       121
  22864.           Data files                   9     Developer's Kit             13
  22865.           Date                               Dialog Box                 217
  22866.                Add                   105     Directory                   87
  22867.                Formatting            113     Directory List             135
  22868.                Get                   109     DirList.J                   59
  22869.                Set                   110     Disk space                 176
  22870.                Set Format            111     Display                     57
  22871.                String                113     Display String             259
  22872.                Subtract              114     Division (/)                36
  22873.           Date conversion            289     DLM format files           151
  22874.           Day of Week (Date:Str)     113     Do Line                     27
  22875.           Db                                 DOS Environment            176
  22876.                Append                115     DOS Errors                 365
  22877.                Close                 117     DOS Shell                  190
  22878.                Create                118     DOS Version                176
  22879.                Delete                119     Dos.J                      191
  22880.                Go                    120     Duplicate
  22881.                Info                  121          Structures, Text      171
  22882.                Lock                  122     Edit                    20, 23
  22883.                Map                   123     Editing  Keys               30
  22884.                NtxOrd                126     Editing Outside             13
  22885.                Pack                  127     EditKey Class               52
  22886.                Read                  128     End of File                156
  22887.                Recall                129     Environment Values         176
  22888.                Seek                  130     EOF in dBASE file          121
  22889.                Set                   131     Equality (=)                37
  22890.                Skip                  132     Error
  22891.                Undelete (Recall)     129          Event            136, 140
  22892.                Unlock                133     Error Messages        345, 365
  22893.                Write                 134     Event
  22894.           dBASE Conversion      123, 151          Add                   136
  22895.           DBASE/Clipper files         10          Delete                138
  22896.           Debugger                    13          Do                    139
  22897.                Starting               13     Exit                   22, 172
  22898.           Debugger  Keys              30     Explode time               340
  22899.           Decimal format        235, 295     Exponent                   225
  22900.           Decimal numbers            295     F1 Key                      54
  22901.           Decmial                            False                      141
  22902.                setting in INI file   340     File
  22903.           Decrement (--)              35          Access           144, 148
  22904.           Delete                                  Append                142
  22905.                Character              97          Backup                143
  22906.  
  22907.           The JORF Manual (Shareware Disk Version)                      368
  22908.  
  22909.  
  22910.  
  22911.  
  22912.  
  22913.  
  22914.  
  22915.                Check existence of   144,     Increment (++)              38
  22916.                                      148     Index - Current (dBASE)    126
  22917.                Close                 145     Indexes                      7
  22918.                Conversion            151     Indexing
  22919.                Copy                  146          Structures              8
  22920.                Delete                147     Inequality (!=)             39
  22921.                Directory              87     Info about JORF/DOS        176
  22922.                Directory list        135     Info in dBASE file         121
  22923.                Exist                 148     Initialization             339
  22924.                Length                149     Initialization File   177, 339
  22925.                Load                  162     InpAfter                    57
  22926.                Map                   151     InpBefore                   57
  22927.                MoveTo                155     Input Fields            68, 71
  22928.                New Project           173     Insert
  22929.                Number of JORF files               Character              99
  22930.                     in use           176          Line                  211
  22931.                Ok                    156     Insert Array                90
  22932.                Print            157, 186     Installation                 i
  22933.                Read                  160     InString                   254
  22934.                Rename                161     Integer
  22935.                Save                  162          Between               224
  22936.                Write                 163          Maximum               227
  22937.           File Load                  150          Minimum               228
  22938.           Finish                      27     Integers                7, 290
  22939.           Finish  Method              28     International numbers      295
  22940.           Floating point numbers       7     Interpret                  170
  22941.           FLRCO                       56     ISA.J
  22942.           Flush Memory          175, 188          Sample Program        242
  22943.           For loop                   164     Jcm2Dbf.J                  115
  22944.           For/Next Loop              164     Jorf
  22945.           Format Date                111          Do (Interpret)        170
  22946.           Found in dBASE file        121          Duplicate             171
  22947.           FoxPro                      10          Global                214
  22948.           Free Memory                176          Info                  176
  22949.           Friend                      31          Ini                   177
  22950.           Friends                     11          INI File              339
  22951.           Function keys               54          Move                  184
  22952.           Function Reference         331          Printers (Printer
  22953.           Get Date (Today)           109               Set up)          341
  22954.           Get Time                   279     JORF Acronym                 1
  22955.           Getting Started             15     JORF Company                 1
  22956.           Global Values              214     JORF.INI File              339
  22957.           Go                      21, 27     JORFPC                      15
  22958.           Goto dBASE record          120     JORFWIN                     15
  22959.           Greater or Equal To (>=)    41     Josephine T. Goat            1
  22960.           Greater Than (>)            40     JRF files                    9
  22961.           Group Boxes                 65     Justify String
  22962.           Haiku.J                    195               (Str:Rpad)       261
  22963.           Here                       166     Key
  22964.           Hotkey                      55          Bye                   199
  22965.           Hypertext Prompt            76          Event            136, 139
  22966.           If/Else                    167          Get                   200
  22967.  
  22968.           Appendix                                                      369
  22969.  
  22970.  
  22971.  
  22972.  
  22973.  
  22974.  
  22975.  
  22976.                Got                   201          Structure elements    184
  22977.                Hit                   202     Move Cursor                219
  22978.           Key lookup dBASE style     130     Moving Structures           11
  22979.           Keyboard Accelerator        55     MS-DOS Version             176
  22980.           Keystroke handling          52     Multiplication (*)          48
  22981.           Last Record                121     Multiuser Status        9, 340
  22982.           Launch programs            190     Music.J                    189
  22983.           Length of Array             91     Name (Rename) File         161
  22984.           Less or Equal To (<=)       43     Negation (-)                49
  22985.           Less Than (<)               42     Negative Numbers           223
  22986.           Library Function                   Network Access          9, 340
  22987.                     Reference        331     New                        220
  22988.           Line                               Next Line                   27
  22989.                Class of Word         328     Next Record
  22990.                Delete                209          dBASE Style           132
  22991.                Input                 210     Next record in file        263
  22992.                Length                272     Ntx order in dBASE file    126
  22993.                Output                212     Null                       222
  22994.                Release               213     Null padding a string      256
  22995.           List (of records)           71     Num
  22996.           Load File                  150          Str                   340
  22997.           Lock Record                181     Number
  22998.                in dBASE file         122          Between               224
  22999.           Logarithm                  226          Exponent              225
  23000.           Logical                                 Formatting            233
  23001.                AND (&&)               44          Logarithm             226
  23002.                NEGATION (!)           45          Maximum               227
  23003.                OR (??)                46          Minimum               228
  23004.           Lower Case                 291          Power                 229
  23005.           Magic                       56          Square Root           232
  23006.           Map dBASE file             123          String                233
  23007.           Map File                   151     Numeric Conversions   233, 292
  23008.           Math                               Numeric formatting         233
  23009.                Method Calls           31     Object Oriented language    22
  23010.           Mathematics                 11     Object Persistence           8
  23011.           Memory Free                176     Object-Attribute-Value       9
  23012.           Memory Management            8     Ok                         236
  23013.           Menu Bars               73, 74     Open                        20
  23014.           Menu Lines                  75     Order of Operations     11, 32
  23015.           Menus                       12     Other  Screen               25
  23016.           Message Window             217     Pack dBASE file            127
  23017.           Method                             Pack Disk File        185, 187
  23018.                Add                   215     Parameters                   5
  23019.                Calls                  31     Parentheses                  4
  23020.                Delete                216     Passing by reference         5
  23021.           Methods and Classes         22     Path (Directory)            87
  23022.           Modulus (%)                 47     Path name                  176
  23023.           Monitor Problems           339     Pick List               58, 93
  23024.           Monochrome Monitors        340     Power (of a number)        229
  23025.           Month name (Date:Str)      113     Prev record
  23026.           Mouse Handler              339          dBASE style           132
  23027.           Move                               Previous record in file    264
  23028.  
  23029.           The JORF Manual (Shareware Disk Version)                      370
  23030.  
  23031.  
  23032.  
  23033.  
  23034.  
  23035.  
  23036.  
  23037.           Print                       21          Haiku.J               195
  23038.           Print File            157, 186          Jcm2Dbf.J             115
  23039.           Printer List                94          Music.J               189
  23040.           Printer menu (Set up in                 TextEdit.J             82
  23041.                     INI file)        341     Sample programs
  23042.           Printer set up             341          ISA.J                 242
  23043.           Problems                   339     Save                        21
  23044.           Program Chaining           172     Save As                     21
  23045.           Programmer's Workbook       15     Save File                  162
  23046.           Programming Environment     13     Say String                 259
  23047.           Programming Windows          3     Screen Colors         339, 342
  23048.           Project file               173     Screen problems            339
  23049.           Prompt                      76     Scroll problems            340
  23050.           Radio Buttons               79     SDF format files           151
  23051.           Ram Disk              339, 341     Search                     321
  23052.           Random Numbers             230     Seek to a dBASE record     130
  23053.           Re-Read                     22     Sequential Files           160
  23054.           Read record in dBASE               Serial port access         258
  23055.                     file             128     Set
  23056.           Reading files              151          Deleted (dBASE)       131
  23057.           Rebuild dBASE file         127          SoftSeek (dBASE)      131
  23058.           Rebuild File          185, 187     Set date                   110
  23059.           Recall dBASE record        129     Set Time                   280
  23060.           Recipe Filers                1     Set time format            281
  23061.           Record Append              142     SHARE                        9
  23062.           Record Lock                181     Shareware Message           16
  23063.           Record Unlock              193     Show  Variables             26
  23064.           Reference                          Show Stack                  25
  23065.                Parameters by           6     Skip record in dBASE       132
  23066.                Quick Language        330     SMARTDRV                     9
  23067.           Release Input              213     Sort Array                  95
  23068.           Reloading a Project         13     Space pad (a string)       257
  23069.           Rename file                161     Stack                      101
  23070.           Replace                    320     String                      80
  23071.           Replicate                               After                 247
  23072.                Str:AtSet             253          At                    248
  23073.           Reread                      20          AtChar                249
  23074.           Restart                     21          AtCut                 250
  23075.           Return                     241          AtDelete              251
  23076.           Rewind                  27, 28          AtPut                 252
  23077.           Right Justify String       261          AtSet                 253
  23078.           Rule                                    Instring              254
  23079.                Add              237, 242          Length                255
  23080.                Delete                243          Null Pad              256
  23081.                Find        244, 246, 262          Pad                   257
  23082.                Next                  245          Print                 258
  23083.           Rule Based System            9          Put Line              260
  23084.           Run                         20          Right Pad             261
  23085.           Sample Program                     String Key
  23086.                Binary.J                5          Add                   204
  23087.                DirList.J              59          Delete                205
  23088.                Dos.J                 191          Find                  206
  23089.  
  23090.           Appendix                                                      371
  23091.  
  23092.  
  23093.  
  23094.  
  23095.  
  23096.  
  23097.  
  23098.                Next                  207          Upper                 297
  23099.                Previous         203, 208     Today's date (Date:Get)    109
  23100.           Strings                      7     Toggle  Break  Point        29
  23101.           Struct Next                263     Trace  Forward              28
  23102.           Struct Prev                264     Translating to C            13
  23103.           Structures                   8     True                       298
  23104.                Blanking elements     184     Type                        56
  23105.                in Data files           9     Undelete a dBASE record    129
  23106.                Moving elements       184     Unlock a dBASE record      133
  23107.           Subtract Date              114     Unlock Record              193
  23108.           Subtract time              284     Upper Case                 297
  23109.           Subtraction (-)             50     Video problems             339
  23110.           Swap File                  339     Weekday (Date:Str)         113
  23111.           Switch/Case/Else      265, 266     While/Break/Continue  299, 300
  23112.           System                     190     Window
  23113.           Text                         7          Add                   301
  23114.                At Line               269          Attribute             309
  23115.                Class of Word         328          Block                 311
  23116.                First Line            276          Change                312
  23117.                Justification    315, 316          Colors                339
  23118.                Last Line             270          FLRCO            315, 316
  23119.                Length                272          Message               317
  23120.                Line Number           274          Message Window        217
  23121.                Next Line             273          Move By               218
  23122.                Position              274          Move To               219
  23123.                Previous Line         275          Pause                 318
  23124.                Width                 277          Pointer               319
  23125.           Text Entry                  81          Put Line              260
  23126.           Text File Load             150          Put String            259
  23127.           Text File Save             162          Replace               320
  23128.           TextEdit.J                  82          Search                321
  23129.           Time                                    Structure             319
  23130.                Addition              278     Window colors              342
  23131.                Formatting            282     Window Manager          12, 51
  23132.                Get (Now)             279     Windows
  23133.                Set                   280          True if running       176
  23134.                Set Format            281     Windows Features             2
  23135.                String                282     Windows Settings            56
  23136.                Subtract              284     Windowstructure             56
  23137.                Ticks                 285     Word
  23138.           Time conversion            296          AtDelete              323
  23139.           To                                      AtInsert              324
  23140.                ASCII                 286          AtPut                 325
  23141.                Capitals              287          In                    326
  23142.                Character             288     Write
  23143.                Date                  289          Item                  194
  23144.                Integer               290          Record                194
  23145.                Lower                 291          Structure             194
  23146.                Num                   340     Write a dBASE record       134
  23147.                Number                292     Writing files              151
  23148.                Numeric String        233
  23149.                Time                  296
  23150.  
  23151.           The JORF Manual (Shareware Disk Version)                      372
  23152.